2021-01-15 09:19:50 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub,
|
2016-06-13 20:26:36 +00:00
|
|
|
bzip2, nix, perl, perlPackages,
|
|
|
|
}:
|
2014-12-14 01:18:14 +00:00
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
with lib;
|
2016-06-13 20:26:36 +00:00
|
|
|
|
|
|
|
let
|
2018-03-20 16:40:35 +00:00
|
|
|
rev = "e4675e38ab54942e351c7686e40fabec822120b9";
|
|
|
|
sha256 = "1wm24p6pkxl1d7hrvf4ph6mwzawvqi22c60z9xzndn5xfyr4v0yr";
|
2016-06-13 20:26:36 +00:00
|
|
|
in
|
2014-12-14 01:18:14 +00:00
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
stdenv.mkDerivation {
|
2016-06-13 20:26:36 +00: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 20:26:36 +00:00
|
|
|
inherit rev sha256;
|
2014-12-14 01:18:14 +00:00
|
|
|
};
|
|
|
|
|
2018-03-05 19:32:42 +00:00
|
|
|
buildInputs = [ bzip2 perl nix nix.perl-bindings ]
|
2015-06-19 02:29:24 +00:00
|
|
|
++ (with perlPackages; [ DBI DBDSQLite Plack Starman ]);
|
2014-12-14 01:18:14 +00:00
|
|
|
|
2016-06-13 20:26:36 +00:00
|
|
|
dontBuild = true;
|
2014-12-14 01:18:14 +00:00
|
|
|
|
2016-05-04 10:08:35 +00: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 20:26:36 +00:00
|
|
|
PATH=${makeBinPath [ bzip2 nix ]}:\$PATH PERL5LIB=$PERL5LIB exec ${perlPackages.Starman}/bin/starman $out/libexec/nix-serve/nix-serve.psgi "\$@"
|
2016-05-04 10:08:35 +00:00
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/nix-serve
|
|
|
|
'';
|
2014-12-14 01:18:14 +00:00
|
|
|
|
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/edolstra/nix-serve";
|
2014-12-14 01:18:14 +00:00
|
|
|
description = "A utility for sharing a Nix store as a binary cache";
|
2016-06-16 13:51:22 +00:00
|
|
|
maintainers = [ maintainers.eelco ];
|
2019-11-17 13:14:56 +00:00
|
|
|
license = licenses.lgpl21;
|
2014-12-14 01:18:14 +00:00
|
|
|
platforms = nix.meta.platforms;
|
|
|
|
};
|
|
|
|
}
|