[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,11 +3,15 @@
}: }:
with lib; with lib;
let let
genPrefList = {locked ? false}: prefs: concatStringsSep "\n" ( genPrefList = {locked ? false}: prefs:
mapAttrsToList let
(key: value: ''lockPref(${toString key}, ${builtins.toJSON value});'') prefFuncName = if locked then "lockPref" else "user_pref";
prefs in
); concatStringsSep "\n" (
mapAttrsToList
(key: value: ''lockPref(${toString key}, ${builtins.toJSON value});'' )
prefs
);
in pkgs.wrapFirefox pkgs.firefox-esr-unwrapped { in pkgs.wrapFirefox pkgs.firefox-esr-unwrapped {
cfg = { cfg = {
smartcardSupport = true; smartcardSupport = true;
@ -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 { } {
}; };
} }