🚀 make arkenfox optional

nixos
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

@ -24,6 +24,8 @@ with lib; {
code.enable = true; code.enable = true;
emacs.enable = true; emacs.enable = true;
firefox = { firefox = {
enable = true;
arkenfox = {
enable = true; enable = true;
overrides = { overrides = {
## arkenfox overrides ## arkenfox overrides
@ -70,6 +72,7 @@ with lib; {
"toolkit.scrollbox.verticalScrollDistance" = 2; "toolkit.scrollbox.verticalScrollDistance" = 2;
}; };
}; };
};
git.signing = true; git.signing = true;
gpg.enable = true; gpg.enable = true;
hub.enable = true; hub.enable = true;

View File

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