Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 stdenv, 3 jq, 4 hydrogen-web-unwrapped, 5 conf ? { }, 6}: 7 8if (conf == { }) then 9 hydrogen-web-unwrapped 10else 11 stdenv.mkDerivation { 12 pname = "${hydrogen-web-unwrapped.pname}-wrapped"; 13 inherit (hydrogen-web-unwrapped) version meta; 14 15 dontUnpack = true; 16 17 nativeBuildInputs = [ jq ]; 18 19 installPhase = '' 20 runHook preInstall 21 22 mkdir -p $out 23 ln -s ${hydrogen-web-unwrapped}/* $out 24 rm $out/config.json 25 jq -s '.[0] * $conf' "${hydrogen-web-unwrapped}/config.json" --argjson "conf" '${builtins.toJSON conf}' > "$out/config.json" 26 27 runHook postInstall 28 ''; 29 }