Files
nixpkgs/pkgs/by-name/el/element-web/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
676 B
Nix
Raw Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
stdenv,
jq,
element-web-unwrapped,
conf ? { },
}:
if (conf == { }) then
element-web-unwrapped
else
stdenv.mkDerivation {
pname = "${element-web-unwrapped.pname}-wrapped";
inherit (element-web-unwrapped) version meta;
dontUnpack = true;
nativeBuildInputs = [ jq ];
installPhase = ''
runHook preInstall
mkdir -p $out
ln -s ${element-web-unwrapped}/* $out
rm $out/config.json
jq -s '.[0] * $conf' "${element-web-unwrapped}/config.json" --argjson "conf" ${lib.escapeShellArg (builtins.toJSON conf)} > "$out/config.json"
runHook postInstall
'';
passthru = {
inherit conf;
};
}