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