From bb606b807cac4d5d88f46a1567fa466db25a740f Mon Sep 17 00:00:00 2001 From: Myned Date: Tue, 18 Feb 2025 09:05:05 -0600 Subject: [PATCH] nix: ignore .*.nix modules Signed-off-by: Myned --- modules/firefox/userChrome.css | 34 ------------- .../custom/programs/firefox/.common.nix | 51 ++++++++----------- options/custom/programs/firefox/firefox.nix | 2 +- options/custom/programs/firefox/librewolf.nix | 2 +- .../custom/programs/firefox/zen-browser.nix | 2 +- options/default.nix | 4 +- 6 files changed, 26 insertions(+), 69 deletions(-) delete mode 100644 modules/firefox/userChrome.css rename modules/firefox/default.nix => options/custom/programs/firefox/.common.nix (96%) diff --git a/modules/firefox/userChrome.css b/modules/firefox/userChrome.css deleted file mode 100644 index 5cf491b..0000000 --- a/modules/firefox/userChrome.css +++ /dev/null @@ -1,34 +0,0 @@ -/*** -https://github.com/rafaelmardojai/firefox-gnome-theme -***/ - -:root { - --gnome-accent: #d33682; - --gnome-window-background: #002b36; - --gnome-window-color: #93a1a1; - --gnome-view-background: #073642; - --gnome-sidebar-background: #002b36; - --gnome-secondary-sidebar-background: #002b36; - --gnome-menu-background: #073642; - --gnome-headerbar-background: #002b36; - --gnome-toolbar-icon-fill: #93a1a1; - --gnome-tabbar-tab-hover-background: #073642; - --gnome-tabbar-tab-active-background: #073642; - --gnome-tabbar-tab-active-hover-background: #073642; -} - -:root:-moz-window-inactive { - --gnome-inactive-entry-color: #586e75; - --gnome-tabbar-tab-hover-background: #073642; - --gnome-tabbar-tab-active-background: #073642; -} - -/* Center bookmarks */ -#PlacesToolbarItems { - justify-content: center; -} - -/* Disable bookmark folder icons */ -.bookmark-item[container] > .toolbarbutton-icon { - display: none; -} diff --git a/modules/firefox/default.nix b/options/custom/programs/firefox/.common.nix similarity index 96% rename from modules/firefox/default.nix rename to options/custom/programs/firefox/.common.nix index ad63c28..07dfafd 100644 --- a/modules/firefox/default.nix +++ b/options/custom/programs/firefox/.common.nix @@ -54,27 +54,31 @@ with lib; { # BUG: Tab groups not yet supported # https://github.com/rafaelmardojai/firefox-gnome-theme/issues/901 - # Import CSS theme with solarized overrides # https://github.com/rafaelmardojai/firefox-gnome-theme # https://github.com/rafaelmardojai/firefox-gnome-theme/blob/master/theme/colors/dark.css - userContent = mkIf theme '' - @import "${inputs.firefox-gnome-theme}/userContent.css"; + userChrome = '' + ${ + if theme + then "@import ${inputs.firefox-gnome-theme}/userChrome.css" + else "" + } + + ${builtins.readFile ./userChrome.css} ''; - userChrome = mkIf theme '' - @import "${inputs.firefox-gnome-theme}/userChrome.css"; - ${builtins.readFile ./userChrome.css} + userContent = '' + ${ + if theme + then "@import ${inputs.firefox-gnome-theme}/userContent.css" + else "" + } + + ${builtins.readFile ./userContent.css} ''; containersForce = true; containers = { - Master = { - color = "pink"; - icon = "circle"; - id = 0; - }; - Edu = { color = "orange"; icon = "fruit"; @@ -198,7 +202,8 @@ with lib; { "full-screen-api.warning.timeout" = 0; "general.autoScroll" = false; "general.smoothScroll" = true; - "gfx.webrender.software" = config.custom.programs.looking-glass.igpu; # Reduce load on iGPU + "general.smoothScroll.msdPhysics.enabled" = true; + "gfx.webrender.software" = false; "identity.fxaccounts.enabled" = true; "layers.acceleration.force-enabled" = true; "layout.css.always_underline_links" = false; @@ -221,7 +226,7 @@ with lib; { "media.videocontrols.picture-in-picture.video-toggle.enabled" = true; "media.videocontrols.picture-in-picture.video-toggle.has-used" = true; "media.videocontrols.picture-in-picture.video-toggle.min-video-secs" = 0; # No minimum duration - "media.videocontrols.picture-in-picture.video-toggle.position" = "top"; + "media.videocontrols.picture-in-picture.video-toggle.position" = "right"; "messaging-system.askForFeedback" = false; "messaging-system.rsexperimentloader.enabled" = false; "middlemouse.paste" = false; @@ -230,7 +235,7 @@ with lib; { "network.dns.disablePrefetchFromHTTPS" = true; "network.http.referer.XOriginPolicy" = 0; # Relaxed "network.predictor.enabled" = false; - "pref.privacy.disable_button.view_passwords" = true; + "pref.privacy.disable_button.view_passwords" = false; "privacy.fingerprintingProtection" = false; "privacy.globalprivacycontrol.enabled" = true; "privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts" = false; @@ -265,20 +270,6 @@ with lib; { "gnomeTheme.bookmarksToolbarUnderTabs" = true; }; - bookmarks = [ - { - name = "Nix User Repository"; - keyword = "nur"; - url = "https://nur.nix-community.org/"; - } - - { - name = "Nix Ryantm"; - keyword = "nry"; - url = "https://ryantm.github.io/nixpkgs/"; - } - ]; - # https://searchfox.org/mozilla-central/rev/669329e284f8e8e2bb28090617192ca9b4ef3380/toolkit/components/search/SearchEngine.jsm#1138-1177 search = { force = true; @@ -468,7 +459,7 @@ with lib; { }; "Niri Issues" = { - definedAliases = ["nri"]; + definedAliases = ["nii"]; iconUpdateURL = "https://github.com/favicon.ico"; urls = [{template = "https://github.com/YaLTeR/niri/issues?q=is%3Aissue+is%3Aopen+{searchTerms}";}]; }; diff --git a/options/custom/programs/firefox/firefox.nix b/options/custom/programs/firefox/firefox.nix index 54a6db0..95c23da 100644 --- a/options/custom/programs/firefox/firefox.nix +++ b/options/custom/programs/firefox/firefox.nix @@ -17,7 +17,7 @@ in { { # https://www.mozilla.org/en-US/firefox/developer programs.firefox = mkMerge [ - (import "${inputs.self}/modules/firefox/default.nix" {inherit config inputs lib pkgs;}) + (import ./.common.nix {inherit config inputs lib pkgs;}) { enable = true; diff --git a/options/custom/programs/firefox/librewolf.nix b/options/custom/programs/firefox/librewolf.nix index 7ed5235..d6234c4 100644 --- a/options/custom/programs/firefox/librewolf.nix +++ b/options/custom/programs/firefox/librewolf.nix @@ -18,7 +18,7 @@ in { # https://librewolf.net/ # https://codeberg.org/librewolf programs.librewolf = mkMerge [ - (import "${inputs.self}/modules/firefox/default.nix" {inherit config inputs lib pkgs;}) + (import ./.common.nix {inherit config inputs lib pkgs;}) { enable = true; diff --git a/options/custom/programs/firefox/zen-browser.nix b/options/custom/programs/firefox/zen-browser.nix index 46e7544..b501a1d 100644 --- a/options/custom/programs/firefox/zen-browser.nix +++ b/options/custom/programs/firefox/zen-browser.nix @@ -18,7 +18,7 @@ in { # https://zen-browser.app/ # https://github.com/youwen5/zen-browser-flake programs.zen-browser = mkMerge [ - (import "${inputs.self}/modules/firefox/default.nix" { + (import ./.common.nix { inherit config inputs lib pkgs; # TODO: Revisit Zen themes diff --git a/options/default.nix b/options/default.nix index 3f02363..0622419 100644 --- a/options/default.nix +++ b/options/default.nix @@ -1,5 +1,5 @@ {lib, ...}: with lib; { - # Import all *.nix options from custom directory - imports = filter (f: strings.hasSuffix ".nix" f) (filesystem.listFilesRecursive ./custom); + # Import all *.nix options from custom directory, excluding .*.nix + imports = filter (f: hasSuffix ".nix" f && !hasPrefix "." (builtins.baseNameOf f)) (filesystem.listFilesRecursive ./custom); }