[Packages/Firefox] Generate prefs according to value of 'locked'

This commit is contained in:
Antoine Viallon 2022-04-30 16:19:32 +02:00
parent 6b2e927fa3
commit 23e11dd2c2
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -3,9 +3,13 @@
}: }:
with lib; with lib;
let let
genPrefList = {locked ? false}: prefs: concatStringsSep "\n" ( genPrefList = {locked ? false}: prefs:
let
prefFuncName = if locked then "lockPref" else "user_pref";
in
concatStringsSep "\n" (
mapAttrsToList mapAttrsToList
(key: value: ''lockPref(${toString key}, ${builtins.toJSON value});'') (key: value: ''lockPref(${toString key}, ${builtins.toJSON value});'' )
prefs prefs
); );
in pkgs.wrapFirefox pkgs.firefox-esr-unwrapped { in pkgs.wrapFirefox pkgs.firefox-esr-unwrapped {
@ -71,5 +75,8 @@ in pkgs.wrapFirefox pkgs.firefox-esr-unwrapped {
"network.IDN_show_punycode" = true; "network.IDN_show_punycode" = true;
"plugins.enumerable_names" = true; "plugins.enumerable_names" = true;
"security.identityblock.show_extended_validation" = true; "security.identityblock.show_extended_validation" = true;
}
+ "\n" + genPrefList { } {
}; };
} }