nixpkgs/pkgs/tools/package-management/nix-serve/default.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

2014-12-14 02:18:14 +01:00
{ lib, stdenv, fetchFromGitHub, perl, nix, perlPackages }:
2015-06-19 04:29:24 +02:00
let rev = "7e09caa2a7a435aeb2cd5446aa590d6f9ae1699d"; in
2014-12-14 02:18:14 +01:00
stdenv.mkDerivation rec {
2015-06-19 04:29:24 +02:00
name = "nix-serve-0.2-${lib.substring 0 7 rev}";
2014-12-14 02:18:14 +01:00
src = fetchFromGitHub {
owner = "edolstra";
repo = "nix-serve";
inherit rev;
2015-06-19 04:29:24 +02:00
sha256 = "0mjzsiknln3isdri9004wwjjjpak5fj8ncizyncf5jv7g4m4q1pj";
2014-12-14 02:18:14 +01:00
};
2015-06-19 04:29:24 +02:00
buildInputs = [ perl nix ]
++ (with perlPackages; [ DBI DBDSQLite Plack Starman ]);
2014-12-14 02:18:14 +01:00
dontBuild = false;
2014-12-14 02:18:14 +01:00
# FIXME: unfortunate cut&paste.
installPhase = ''
mkdir -p $out/libexec/nix-serve
cp nix-serve.psgi $out/libexec/nix-serve/nix-serve.psgi
mkdir -p $out/bin
cat > $out/bin/nix-serve <<EOF
#! ${stdenv.shell}
PERL5LIB=$PERL5LIB exec ${perlPackages.Starman}/bin/starman $out/libexec/nix-serve/nix-serve.psgi "\$@"
EOF
chmod +x $out/bin/nix-serve
'';
2014-12-14 02:18:14 +01:00
meta = {
homepage = https://github.com/edolstra/nix-serve;
description = "A utility for sharing a Nix store as a binary cache";
maintainers = [ lib.maintainers.eelco ];
license = lib.licenses.gpl3;
platforms = nix.meta.platforms;
};
}