This commit is contained in:
caem 2025-01-25 13:54:47 +01:00
parent 965f7c0a09
commit fdc80061c3
Signed by: caem
GPG key ID: 69A830D03203405F

View file

@ -1,12 +1,21 @@
let
prefToString = value:
if builtins.isBool value then
if value then "true" else "false"
else if (builtins.isInt value) || (builtins.isNull value) then
builtins.toString value
else if builtins.isString value then
value
else
builtins.throw
"Pref expected one of (Bool, String, Int, Null) got instead ${builtins.typeOf value}";
mkPrefs = prefs: builtins.concatStringsSep
"\n"
(builtins.attrValues
(builtins.mapAttrs
(n: v: ''user_pref("${n}", "${v}");'') prefs));
(n: v: ''user_pref("${n}", "${(prefToString v)}");'') prefs));
in
mkPrefs {
prefs = {
"browser.urlbar.suggest.topsites" = false;
};
"browser.urlbar.suggest.topsites" = "false";
}