🚀 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

@ -25,49 +25,52 @@ with lib; {
emacs.enable = true; emacs.enable = true;
firefox = { firefox = {
enable = true; enable = true;
overrides = { arkenfox = {
## arkenfox overrides enable = true;
# automatic search overrides = {
"keyword.enabled" = true; ## arkenfox overrides
"browser.search.suggest.enabled" = true; # automatic search
"browser.urlbar.suggest.searches" = true; "keyword.enabled" = true;
"browser.search.suggest.enabled" = true;
"browser.urlbar.suggest.searches" = true;
# startup page # startup page
"browser.startup.homepage" = "https://searxng.moritzboeh.me/"; "browser.startup.homepage" = "https://searxng.moritzboeh.me/";
"browser.startup.page" = 1; "browser.startup.page" = 1;
# drm # drm
"media.eme.enabled" = true; "media.eme.enabled" = true;
# sanitisation # sanitisation
"privacy.clearOnShutdown.history" = false; "privacy.clearOnShutdown.history" = false;
# disable letterboxing # disable letterboxing
"privacy.resistFingerprinting.letterboxing" = false; "privacy.resistFingerprinting.letterboxing" = false;
## OTHER ## OTHER
# Dont show warning when accessing about:config # Dont show warning when accessing about:config
"browser.aboutConfig.showWarning" = false; "browser.aboutConfig.showWarning" = false;
# Hide bookmarks # Hide bookmarks
"browser.toolbars.bookmarks.visibility" = "never"; "browser.toolbars.bookmarks.visibility" = "never";
# Smooth scrolling # Smooth scrolling
"general.smoothScroll.lines.durationMaxMS" = 125; "general.smoothScroll.lines.durationMaxMS" = 125;
"general.smoothScroll.lines.durationMinMS" = 125; "general.smoothScroll.lines.durationMinMS" = 125;
"general.smoothScroll.mouseWheel.durationMaxMS" = 200; "general.smoothScroll.mouseWheel.durationMaxMS" = 200;
"general.smoothScroll.mouseWheel.durationMinMS" = 100; "general.smoothScroll.mouseWheel.durationMinMS" = 100;
"general.smoothScroll.msdPhysics.enabled" = true; "general.smoothScroll.msdPhysics.enabled" = true;
"general.smoothScroll.other.durationMaxMS" = 125; "general.smoothScroll.other.durationMaxMS" = 125;
"general.smoothScroll.other.durationMinMS" = 125; "general.smoothScroll.other.durationMinMS" = 125;
"general.smoothScroll.pages.durationMaxMS" = 125; "general.smoothScroll.pages.durationMaxMS" = 125;
"general.smoothScroll.pages.durationMinMS" = 125; "general.smoothScroll.pages.durationMinMS" = 125;
"mousewheel.min_line_scroll_amount" = 40; "mousewheel.min_line_scroll_amount" = 40;
"mousewheel.system_scroll_override_on_root_content.enabled" = true; "mousewheel.system_scroll_override_on_root_content.enabled" = true;
"mousewheel.system_scroll_override_on_root_content.horizontal.factor" = 175; "mousewheel.system_scroll_override_on_root_content.horizontal.factor" = 175;
"mousewheel.system_scroll_override_on_root_content.vertical.factor" = 175; "mousewheel.system_scroll_override_on_root_content.vertical.factor" = 175;
"toolkit.scrollbox.horizontalScrollDistance" = 6; "toolkit.scrollbox.horizontalScrollDistance" = 6;
"toolkit.scrollbox.verticalScrollDistance" = 2; "toolkit.scrollbox.verticalScrollDistance" = 2;
};
}; };
}; };
git.signing = true; git.signing = true;

View File

@ -17,30 +17,33 @@ in
type = types.bool; type = types.bool;
example = true; example = true;
}; };
overrides = mkOption { arkenfox = {
default = { }; enable = mkEnableOption "arkenfox";
type = with types; attrsOf (oneOf [ str bool int ]); overrides = mkOption {
apply = overrides: lib.concatStrings ( default = { };
lib.mapAttrsToList type = with types; attrsOf (oneOf [ str bool int ]);
( apply = overrides: concatStrings (
name: value: '' mapAttrsToList
user_pref("${name}", ${builtins.toJSON value}); (
'' name: value: ''
) user_pref("${name}", ${builtins.toJSON value});
overrides ''
); )
overrides
);
};
}; };
}; };
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}
''; '';
}; };
}; };