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