nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 coreutils,
5 findutils,
6 nix,
7 xz,
8 bzip2,
9 gnused,
10 gnugrep,
11 openssl,
12 lighttpd,
13 iproute2,
14}:
15stdenv.mkDerivation {
16 version = "2014-06-29-1";
17 pname = "nix-binary-cache";
18
19 dontUnpack = true;
20
21 installPhase = ''
22 mkdir -p "$out/bin"
23 substitute "${./nix-binary-cache.cgi.in}" "$out"/bin/nix-binary-cache.cgi \
24 --replace @out@ "$out/bin" \
25 --replace @shell@ "${stdenv.shell}" \
26 --replace @coreutils@ "${coreutils}/bin" \
27 --replace @findutils@ "${findutils}/bin" \
28 --replace @nix@ "${nix.out}/bin" \
29 --replace @xz@ "${xz.bin}/bin" \
30 --replace @bzip2@ "${bzip2.bin}/bin" \
31 --replace @gnused@ "${gnused}/bin" \
32 --replace @gnugrep@ "${gnugrep}/bin" \
33 --replace @openssl@ "${openssl.bin}/bin" \
34 --replace @lighttpd@ "${lighttpd}/sbin" \
35 --replace @iproute@ "${iproute2}/sbin" \
36 --replace "xXxXx" "xXxXx"
37
38 chmod a+x "$out/bin/nix-binary-cache.cgi"
39
40 substitute "${./nix-binary-cache-start.in}" "$out"/bin/nix-binary-cache-start \
41 --replace @out@ "$out/bin" \
42 --replace @shell@ "${stdenv.shell}" \
43 --replace @coreutils@ "${coreutils}/bin" \
44 --replace @findutils@ "${findutils}/bin" \
45 --replace @nix@ "${nix.out}/bin" \
46 --replace @xz@ "${xz.bin}/bin" \
47 --replace @bzip2@ "${bzip2.bin}/bin" \
48 --replace @gnused@ "${gnused}/bin" \
49 --replace @gnugrep@ "${gnugrep}/bin" \
50 --replace @openssl@ "${openssl.bin}/bin" \
51 --replace @lighttpd@ "${lighttpd}/sbin" \
52 --replace @iproute@ "${iproute2}/sbin" \
53 --replace "xXxXx" "xXxXx"
54
55 chmod a+x "$out/bin/nix-binary-cache-start"
56 '';
57
58 meta = {
59 description = "Set of scripts to serve the Nix store as a binary cache";
60 longDescription = ''
61 This package installs a CGI script that serves Nix store path in the
62 binary cache format. It also installs a launcher called
63 nix-binary-cache-start that can be run without any setup to launch
64 a binary cache and get the example arguments for its usage.
65 '';
66 maintainers = [ lib.maintainers.raskin ];
67 license = lib.licenses.gpl2Plus;
68 platforms = lib.platforms.all;
69 hydraPlatforms = [ ];
70 };
71}