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

46 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, fetchpatch,
bzip2, nix, perl, perlPackages,
}:
2014-12-13 18:18:14 -07:00
with stdenv.lib;
let
rev = "e4675e38ab54942e351c7686e40fabec822120b9";
sha256 = "1wm24p6pkxl1d7hrvf4ph6mwzawvqi22c60z9xzndn5xfyr4v0yr";
in
2014-12-13 18:18:14 -07:00
stdenv.mkDerivation rec {
name = "nix-serve-0.2-${substring 0 7 rev}";
2014-12-13 18:18:14 -07:00
src = fetchFromGitHub {
owner = "edolstra";
repo = "nix-serve";
inherit rev sha256;
2014-12-13 18:18:14 -07:00
};
2018-03-05 12:32:42 -07:00
buildInputs = [ bzip2 perl nix nix.perl-bindings ]
2015-06-18 20:29:24 -06:00
++ (with perlPackages; [ DBI DBDSQLite Plack Starman ]);
2014-12-13 18:18:14 -07:00
dontBuild = true;
2014-12-13 18:18:14 -07:00
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}
PATH=${makeBinPath [ bzip2 nix ]}:\$PATH PERL5LIB=$PERL5LIB exec ${perlPackages.Starman}/bin/starman $out/libexec/nix-serve/nix-serve.psgi "\$@"
EOF
chmod +x $out/bin/nix-serve
'';
2014-12-13 18:18:14 -07:00
meta = {
homepage = https://github.com/edolstra/nix-serve;
description = "A utility for sharing a Nix store as a binary cache";
maintainers = [ maintainers.eelco ];
license = licenses.gpl3;
2014-12-13 18:18:14 -07:00
platforms = nix.meta.platforms;
};
}