Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 32 lines 630 B view raw
1{ 2 cinny-unwrapped, 3 jq, 4 stdenvNoCC, 5 writeText, 6 conf ? { }, 7}: 8let 9 configOverrides = writeText "cinny-config-overrides.json" (builtins.toJSON conf); 10in 11if (conf == { }) then 12 cinny-unwrapped 13else 14 stdenvNoCC.mkDerivation { 15 pname = "cinny"; 16 inherit (cinny-unwrapped) version meta; 17 18 dontUnpack = true; 19 20 nativeBuildInputs = [ jq ]; 21 22 installPhase = '' 23 runHook preInstall 24 25 mkdir -p $out 26 ln -s ${cinny-unwrapped}/* $out 27 rm $out/config.json 28 jq -s '.[0] * .[1]' "${cinny-unwrapped}/config.json" "${configOverrides}" > "$out/config.json" 29 30 runHook postInstall 31 ''; 32 }