🚀 make arkenfox optional

This commit is contained in:
Moritz Böhme 2022-08-31 11:42:43 +02:00
parent 4baf4307b8
commit e427f3cd56
2 changed files with 56 additions and 50 deletions

View file

@ -17,30 +17,33 @@ in
type = types.bool;
example = true;
};
overrides = mkOption {
default = { };
type = with types; attrsOf (oneOf [ str bool int ]);
apply = overrides: lib.concatStrings (
lib.mapAttrsToList
(
name: value: ''
user_pref("${name}", ${builtins.toJSON value});
''
)
overrides
);
arkenfox = {
enable = mkEnableOption "arkenfox";
overrides = mkOption {
default = { };
type = with types; attrsOf (oneOf [ str bool int ]);
apply = overrides: concatStrings (
mapAttrsToList
(
name: value: ''
user_pref("${name}", ${builtins.toJSON value});
''
)
overrides
);
};
};
};
config = mkIf cfg.enable {
home-manager.users.moritz.programs.firefox = {
enable = true;
profiles."default".extraConfig = ''
profiles."default".extraConfig = mkIf cfg.arkenfox.enable ''
// Arkenfox user.js
${arkenfox}
// Overrides
${cfg.overrides}
${cfg.arkenfox.overrides}
'';
};
};