aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
authortilpner2020-05-18 13:04:08 +0200
committertilpner2020-05-18 13:04:08 +0200
commit63528355a9b9f492809a777d9ac8d6e529688b02 (patch)
treeb8bd0610980dd55521fe0d58c6830674770635d3 /nix
parent9e60a30afa8aef1fd2258a0217b02cdb3bd123a5 (diff)
downloadfirefox-profiles-63528355a9b9f492809a777d9ac8d6e529688b02.tar.gz
firefox-profiles-63528355a9b9f492809a777d9ac8d6e529688b02.tar.xz
firefox-profiles-63528355a9b9f492809a777d9ac8d6e529688b02.zip
Patch custom qwantjunior addon into omni.ja
Diffstat (limited to 'nix')
-rw-r--r--nix/lib.nix12
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";