From b7e2ecbd46d3627ecc1786eea80e73f398fc4c1a Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Sat, 21 Sep 2024 14:44:50 +0300 Subject: [PATCH] Split firefox config --- users/functionalhacker/home.nix | 64 +------------------ users/functionalhacker/programs/firefox.nix | 70 +++++++++++++++++++++ 2 files changed, 72 insertions(+), 62 deletions(-) create mode 100644 users/functionalhacker/programs/firefox.nix diff --git a/users/functionalhacker/home.nix b/users/functionalhacker/home.nix index e1eae4d2..33d94724 100644 --- a/users/functionalhacker/home.nix +++ b/users/functionalhacker/home.nix @@ -1,9 +1,9 @@ -{ lib, config, pkgs, inputs, ... }: +{ lib, config, pkgs, ... }: with lib.hm.gvariant; { - imports = [ inputs.nur.hmModules.nur ]; + imports = [ ./programs/firefox.nix ]; home = { username = "functionalhacker"; homeDirectory = "/home/functionalhacker"; @@ -30,9 +30,6 @@ with lib.hm.gvariant; # Declarative configuration coming soon™ ".config/nvim".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/git/dotfiles/home/.config/nvim"; - - # Get firefox-gnome-theme files from flake inputs - ".mozilla/firefox/functionalhacker/chrome/firefox-gnome-theme".source = inputs.firefox-gnome-theme; }; }; @@ -295,63 +292,6 @@ with lib.hm.gvariant; }; }; - firefox = { - enable = true; - - profiles.functionalhacker = { - name = "FunctionalHacker"; - userChrome = '' - @import "firefox-gnome-theme/userChrome.css"; - ''; - userContent = '' - @import "firefox-gnome-theme/userContent.css"; - ''; - settings = { - ## Firefox gnome theme ## - https://github.com/rafaelmardojai/firefox-gnome-theme/blob/1c32013cdbe17406de496cdf5f6899b84c4bbfed/configuration/user.js - # (copied into here because home-manager already writes to user.js) - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Enable customChrome.cs - # Set UI density to normal - "browser.uidensity" = 0; - - # Enable SVG context-propertes - "svg.context-properties.content.enabled" = true; - - # Disable private window dark theme - "browser.theme.dark-private-windows" = false; - - # Enable rounded bottom window corners - "widget.gtk.rounded-bottom-corners.enabled" = true; - - # Firefox gnome theme optional settings - "gnomeTheme.hideSingleTab" = true; - "gnomeTheme.hideWebrtcIndicator" = true; - - # Auto enable installed addons - "extensions.autoDisableScopes" = 0; - }; - search = { - default = "Korhonen Search"; - engines = { - "Korhonen Search" = { - urls = [ - { - template = "https://search.korhonen.cc/search?q={searchTerms}"; - iconUpdateURL = "https://search.korhonen.cc/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; # Once a day - } - ]; - }; - }; - }; - - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - browserpass - darkreader - ]; - - }; - }; - password-store = { enable = true; package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]); diff --git a/users/functionalhacker/programs/firefox.nix b/users/functionalhacker/programs/firefox.nix new file mode 100644 index 00000000..b72ca750 --- /dev/null +++ b/users/functionalhacker/programs/firefox.nix @@ -0,0 +1,70 @@ +{ pkgs, inputs, ... }: +{ + home = { + file = { + # Get firefox-gnome-theme files from flake inputs + ".mozilla/firefox/functionalhacker/chrome/firefox-gnome-theme".source = inputs.firefox-gnome-theme; + }; + }; + + programs.firefox = { + enable = true; + + profiles.functionalhacker = { + name = "FunctionalHacker"; + + userChrome = '' + @import "firefox-gnome-theme/userChrome.css"; + ''; + + userContent = '' + @import "firefox-gnome-theme/userContent.css"; + ''; + + settings = { + ## Firefox gnome theme ## - https://github.com/rafaelmardojai/firefox-gnome-theme/blob/1c32013cdbe17406de496cdf5f6899b84c4bbfed/configuration/user.js + # (copied into here because home-manager already writes to user.js) + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Enable customChrome.cs + # Set UI density to normal + "browser.uidensity" = 0; + + # Enable SVG context-propertes + "svg.context-properties.content.enabled" = true; + + # Disable private window dark theme + "browser.theme.dark-private-windows" = false; + + # Enable rounded bottom window corners + "widget.gtk.rounded-bottom-corners.enabled" = true; + + # Firefox gnome theme optional settings + "gnomeTheme.hideSingleTab" = true; + "gnomeTheme.hideWebrtcIndicator" = true; + + # Auto enable installed addons + "extensions.autoDisableScopes" = 0; + }; + + search = { + default = "Korhonen Search"; + engines = { + "Korhonen Search" = { + urls = [ + { + template = "https://search.korhonen.cc/search?q={searchTerms}"; + iconUpdateURL = "https://search.korhonen.cc/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; # Once a day + } + ]; + }; + }; + }; + + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + browserpass + darkreader + ]; + + }; + }; +}