diff options
Diffstat (limited to 'nix')
-rw-r--r-- | nix/lib.nix | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/nix/lib.nix b/nix/lib.nix index 1095ab4..93b3dc8 100644 --- a/nix/lib.nix +++ b/nix/lib.nix @@ -49,11 +49,20 @@ rec { final = lib.foldl lib.recursiveUpdate {} sanitised; in final; - bundle = { policies ? {}, preferences ? {} }: + patchOmniJa = src: script: pkgs.runCommand "omni.ja" { } '' + ${pkgs.unzip}/bin/unzip -q ${src} + + ${script} + + ${pkgs.zip}/bin/zip -qr9XD $out . + ''; + + bundle = { policies ? {}, preferences ? {}, patchOmniJaCommand ? "" }: let firefox = pkgs.firefox-unwrapped; policies' = mkPolicies policies; preferences' = mkPrefs preferences; + patchedOmniJa = patchOmniJa "${firefox}/lib/firefox/browser/omni.ja" patchOmniJaCommand; patched = pkgs.runCommand "firefox-bundle" { nativeBuildInputs = [ pkgs.nix ]; disallowedReferences = [ firefox ]; @@ -67,6 +76,7 @@ rec { mkdir $out/lib/firefox/distribution cp ${policies'} $out/lib/firefox/distribution/policies.json cp ${preferences'} $out/lib/firefox/defaults/pref/99-custom.js + cp ${patchedOmniJa} $out/lib/firefox/browser/omni.ja ''; wrapped = (pkgs.wrapFirefox patched { browserName = "firefox"; |