@@ -41,7 +41,7 @@ let
4141 # https://github.com/mozilla/policy-templates#enterprisepoliciesenabled
4242 , extraPolicies ? {}
4343 , firefoxLibName ? "firefox" # Important for tor package or the like
44− , extraExtensions ? [ ]
44+ , nixExtensions ? null
4545 }:
4646
4747 assert forceWayland -> (browser ? gtk3); # Can only use the wayland backend if gtk3 is being used
@@ -100,19 +100,21 @@ let
100100 policiesJson = builtins.toFile "policies.json"
101101 (builtins.toJSON enterprisePolicies);
102102
103+ usesNixExtensions = nixExtensions != null;
104+
103105 extensions = builtins.map (a:
104106 if ! (builtins.hasAttr "extid" a) then
105− throw "extraExtensions has an invalid entry. Missing extid attribute. Please use fetchfirefoxaddon"
107+ throw "nixExtensions has an invalid entry. Missing extid attribute. Please use fetchfirefoxaddon"
106108 else
107109 a
108− ) extraExtensions;
110+ ) (if usesNixExtensions then nixExtensions else []);
109111
110112 enterprisePolicies =
111113 {
112− policies = {
114+ policies = lib.optionalAttrs usesNixExtensions {
113115 DisableAppUpdate = true;
114116 } //
115− {
117+ lib.optionalAttrs usesNixExtensions {
116118 ExtensionSettings = {
117119 "*" = {
118120 blocked_install_message = "You can't have manual extension mixed with nix extensions";
@@ -137,7 +139,7 @@ let
137139 // to be able to install addons that do not have an extid
138140 // Security is maintained because only user whitelisted addons
139141 // with a checksum can be installed
140− lockPref("xpinstall.signatures.required", false);
142+ ${ lib.optionalString usesNixExtensions ''lockPref("xpinstall.signatures.required", false)'' };
141143 ${extraPrefs}
142144 '';
143145