[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;
let
genPrefList = {locked ? false}: prefs: concatStringsSep "\n" (
mapAttrsToList
(key: value: ''lockPref(${toString key}, ${builtins.toJSON value});'')
prefs
);
genPrefList = {locked ? false}: prefs:
let
prefFuncName = if locked then "lockPref" else "user_pref";
in
concatStringsSep "\n" (
mapAttrsToList
(key: value: ''lockPref(${toString key}, ${builtins.toJSON value});'' )
prefs
);
in pkgs.wrapFirefox pkgs.firefox-esr-unwrapped {
cfg = {
smartcardSupport = true;
@ -71,5 +75,8 @@ in pkgs.wrapFirefox pkgs.firefox-esr-unwrapped {
"network.IDN_show_punycode" = true;
"plugins.enumerable_names" = true;
"security.identityblock.show_extended_validation" = true;
}
+ "\n" + genPrefList { } {
};
}