forked from edolstra/nix-serve
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.nix
43 lines (35 loc) · 1.21 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ pkgs, debug ? false, ... }:
with pkgs;
with lib;
with stdenv.lib;
stdenv.mkDerivation {
pname = "nix-serve-nothing";
version = "0.5";
src = ./.;
buildInputs = [ bzip2 perl nix nix.perl-bindings ]
++ (with perlPackages;
[ GetoptLong LWPProtocolHttps Plack PlackAppProxy StringShellQuote Starman ]);
dontBuild = true;
installPhase = ''
mkdir -p $out/libexec/nix-serve-nothing
cp nix-serve-nothing.psgi $out/libexec/nix-serve-nothing/nix-serve-nothing.psgi
mkdir -p $out/bin
cat > $out/bin/nix-serve-nothing <<EOF
#! ${stdenv.shell}
NIX_SERVE_NOTHING_DEBUG=${toString debug} PATH=${makeBinPath [ bzip2 nix ]}:\$PATH PERL5LIB=$PERL5LIB exec ${perlPackages.Starman}/bin/starman $out/libexec/nix-serve-nothing/nix-serve-nothing.psgi "\$@"
EOF
chmod +x $out/bin/nix-serve-nothing
'';
meta = {
homepage = "https://github.com/jskrzypek/nix-serve-nothing";
description = "A utility for sharing absolutely nothing as a binary cache";
maintainers = [{
email = "[email protected]";
github = "jskrzypek";
githubId = 1513265;
name = "Joshua Skrzypek";
}];
license = licenses.lgpl21;
platforms = nix.meta.platforms;
};
}