nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 jq,
5 element-web-unwrapped,
6 conf ? { },
7}:
8
9if (conf == { }) then
10 element-web-unwrapped
11else
12 stdenv.mkDerivation {
13 pname = "${element-web-unwrapped.pname}-wrapped";
14 inherit (element-web-unwrapped) version meta;
15
16 dontUnpack = true;
17
18 nativeBuildInputs = [ jq ];
19
20 installPhase = ''
21 runHook preInstall
22
23 mkdir -p $out
24 ln -s ${element-web-unwrapped}/* $out
25 rm $out/config.json
26 jq -s '.[0] * $conf' "${element-web-unwrapped}/config.json" --argjson "conf" ${lib.escapeShellArg (builtins.toJSON conf)} > "$out/config.json"
27
28 runHook postInstall
29 '';
30
31 passthru = {
32 inherit conf;
33 };
34 }