Refactor the whole configuration #1

Merged
caem merged 354 commits from refactor into master 2025-02-01 14:05:16 +01:00
Showing only changes of commit fdc80061c3 - Show all commits

View file

@ -1,12 +1,21 @@
let 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 mkPrefs = prefs: builtins.concatStringsSep
"\n" "\n"
(builtins.attrValues (builtins.attrValues
(builtins.mapAttrs (builtins.mapAttrs
(n: v: ''user_pref("${n}", "${v}");'') prefs)); (n: v: ''user_pref("${n}", "${(prefToString v)}");'') prefs));
in in
mkPrefs { mkPrefs {
prefs = { "browser.urlbar.suggest.topsites" = "false";
"browser.urlbar.suggest.topsites" = false;
};
} }