From e427f3cd56e0b5c2d4b0e222da47dd8400d83603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Wed, 31 Aug 2022 11:42:43 +0200 Subject: [PATCH] :rocket: make arkenfox optional --- modules/profiles/desktop.nix | 75 +++++++++++++++++++----------------- modules/programs/firefox.nix | 31 ++++++++------- 2 files changed, 56 insertions(+), 50 deletions(-) diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix index 0e2da44..257af11 100644 --- a/modules/profiles/desktop.nix +++ b/modules/profiles/desktop.nix @@ -25,49 +25,52 @@ with lib; { emacs.enable = true; firefox = { enable = true; - overrides = { - ## arkenfox overrides - # automatic search - "keyword.enabled" = true; - "browser.search.suggest.enabled" = true; - "browser.urlbar.suggest.searches" = true; + arkenfox = { + enable = true; + overrides = { + ## arkenfox overrides + # automatic search + "keyword.enabled" = true; + "browser.search.suggest.enabled" = true; + "browser.urlbar.suggest.searches" = true; - # startup page - "browser.startup.homepage" = "https://searxng.moritzboeh.me/"; - "browser.startup.page" = 1; + # startup page + "browser.startup.homepage" = "https://searxng.moritzboeh.me/"; + "browser.startup.page" = 1; - # drm - "media.eme.enabled" = true; + # drm + "media.eme.enabled" = true; - # sanitisation - "privacy.clearOnShutdown.history" = false; + # sanitisation + "privacy.clearOnShutdown.history" = false; - # disable letterboxing - "privacy.resistFingerprinting.letterboxing" = false; + # disable letterboxing + "privacy.resistFingerprinting.letterboxing" = false; - ## OTHER - # Dont show warning when accessing about:config - "browser.aboutConfig.showWarning" = false; + ## OTHER + # Dont show warning when accessing about:config + "browser.aboutConfig.showWarning" = false; - # Hide bookmarks - "browser.toolbars.bookmarks.visibility" = "never"; + # Hide bookmarks + "browser.toolbars.bookmarks.visibility" = "never"; - # Smooth scrolling - "general.smoothScroll.lines.durationMaxMS" = 125; - "general.smoothScroll.lines.durationMinMS" = 125; - "general.smoothScroll.mouseWheel.durationMaxMS" = 200; - "general.smoothScroll.mouseWheel.durationMinMS" = 100; - "general.smoothScroll.msdPhysics.enabled" = true; - "general.smoothScroll.other.durationMaxMS" = 125; - "general.smoothScroll.other.durationMinMS" = 125; - "general.smoothScroll.pages.durationMaxMS" = 125; - "general.smoothScroll.pages.durationMinMS" = 125; - "mousewheel.min_line_scroll_amount" = 40; - "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.vertical.factor" = 175; - "toolkit.scrollbox.horizontalScrollDistance" = 6; - "toolkit.scrollbox.verticalScrollDistance" = 2; + # Smooth scrolling + "general.smoothScroll.lines.durationMaxMS" = 125; + "general.smoothScroll.lines.durationMinMS" = 125; + "general.smoothScroll.mouseWheel.durationMaxMS" = 200; + "general.smoothScroll.mouseWheel.durationMinMS" = 100; + "general.smoothScroll.msdPhysics.enabled" = true; + "general.smoothScroll.other.durationMaxMS" = 125; + "general.smoothScroll.other.durationMinMS" = 125; + "general.smoothScroll.pages.durationMaxMS" = 125; + "general.smoothScroll.pages.durationMinMS" = 125; + "mousewheel.min_line_scroll_amount" = 40; + "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.vertical.factor" = 175; + "toolkit.scrollbox.horizontalScrollDistance" = 6; + "toolkit.scrollbox.verticalScrollDistance" = 2; + }; }; }; git.signing = true; diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index ebab0cf..ee4cab0 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -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} ''; }; };