diff --git a/flake.lock b/flake.lock index a3ed534..1696d7f 100644 --- a/flake.lock +++ b/flake.lock @@ -17,6 +17,28 @@ "type": "github" } }, + "firefox-addons": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "dir": "pkgs/firefox-addons", + "lastModified": 1780977789, + "narHash": "sha256-UFJfQlvInbsVaTK5XC2lafdqWlwiNP5LuQFYfDKq6Dc=", + "owner": "rycee", + "repo": "nur-expressions", + "rev": "0b627f105ea3baa2fa10308a6a67a8f8cbbb3e2a", + "type": "gitlab" + }, + "original": { + "dir": "pkgs/firefox-addons", + "owner": "rycee", + "repo": "nur-expressions", + "type": "gitlab" + } + }, "flake-compat": { "locked": { "lastModified": 1761640442, @@ -204,6 +226,7 @@ }, "root": { "inputs": { + "firefox-addons": "firefox-addons", "flake-parts": "flake-parts", "home-manager": "home-manager", "nix-darwin": "nix-darwin", diff --git a/flake.nix b/flake.nix index c860a3e..07ee130 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,11 @@ # Provides mkFlake: the systems/perSystem scaffolding used below. flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; + # Declarative Firefox add-ons (e.g. the Catppuccin theme); see lyrathorpe/user.nix. + firefox-addons = { + url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = diff --git a/lyrathorpe/home/desktop.nix b/lyrathorpe/home/desktop.nix index 0bfddf4..da6f757 100644 --- a/lyrathorpe/home/desktop.nix +++ b/lyrathorpe/home/desktop.nix @@ -2,7 +2,13 @@ # Imported only on hosts that run Sway (MBP, T400, Mac Pro); never pulled onto # the headless WSL host. Login (and the Sway session launch) is handled by the # greetd/ReGreet greeter -- see ../swaywm.nix -- so there is no tty1 autostart. -{ pkgs, config, ... }: +{ + pkgs, + config, + inputs, + username, + ... +}: { imports = [ ./sway.nix @@ -57,4 +63,31 @@ name = "Adwaita"; size = 24; }; + + # Firefox is themed at the browser level (it does not follow the GTK theme). + # The system installs the binary (programs.firefox in ../user.nix); here + # home-manager owns only the profile, hence package = null. Apply the + # Catppuccin Mocha theme add-on (only the mauve accent is packaged upstream; + # the rest of the desktop uses blue) and make content + UI dark. + programs.firefox = { + enable = true; + package = null; + profiles.${username} = { + id = 0; + isDefault = true; + extensions = { + force = true; + packages = [ + inputs.firefox-addons.packages.${pkgs.system}.catppuccin-mocha-mauve + ]; + }; + settings = { + # Enable bundled add-ons automatically so the theme applies on first run. + "extensions.autoDisableScopes" = 0; + # Dark chrome + dark page content. + "ui.systemUsesDarkTheme" = 1; + "layout.css.prefers-color-scheme.content-override" = 0; + }; + }; + }; }