Compare commits

..

2 Commits

Author SHA1 Message Date
Emma Thorpe 745188c3cf feat(firefox): theme with the Catppuccin Mocha add-on
CI / flake (pull_request) Failing after 1m10s
Firefox draws its own chrome and ignores the GTK theme, so theme it at the
browser level. Add the rycee firefox-addons flake input and, in the
home-manager desktop layer, manage the Firefox profile (package = null --
the system programs.firefox in user.nix still provides the binary):

- install the Catppuccin Mocha theme add-on (catppuccin-mocha-mauve; only
  the mauve accent is packaged upstream, so it differs slightly from the
  blue accent used elsewhere),
- autoDisableScopes = 0 so it applies on first launch,
- ui.systemUsesDarkTheme + prefers-color-scheme override for dark chrome
  and page content.

Verified the XPI fetches, user.js renders the prefs, finalPackage is null
(no duplicate Firefox), all Sway hosts eval, and EDaaS is unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 21:14:00 +01:00
Emma Thorpe 416fbcae52 feat(gtk): theme GTK4 apps to match (import catppuccin gtk-4.0 CSS)
Set gtk.gtk4.theme = config.gtk.theme so any GTK4 app added later is
themed too. GTK4 ignores gtk-theme-name, but home-manager renders this as
an `@import` of the theme's gtk-4.0/gtk.css into ~/.config/gtk-4.0/gtk.css
-- which libadwaita honours, since that file overrides the named colours
it uses (window_bg_color/accent_bg_color/view_bg_color, verified present
in catppuccin-gtk's GTK4 stylesheet). Setting it explicitly (to the same
value as the legacy default) also silences the stateVersion<26.05
default-change warning. nemo (GTK3) is unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 21:05:44 +01:00
3 changed files with 69 additions and 1 deletions
Generated
+23
View File
@@ -17,6 +17,28 @@
"type": "github" "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": { "flake-compat": {
"locked": { "locked": {
"lastModified": 1761640442, "lastModified": 1761640442,
@@ -204,6 +226,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"firefox-addons": "firefox-addons",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-darwin": "nix-darwin", "nix-darwin": "nix-darwin",
+5
View File
@@ -23,6 +23,11 @@
# Provides mkFlake: the systems/perSystem scaffolding used below. # Provides mkFlake: the systems/perSystem scaffolding used below.
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; 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 = outputs =
+41 -1
View File
@@ -2,7 +2,13 @@
# Imported only on hosts that run Sway (MBP, T400, Mac Pro); never pulled onto # 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 # 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. # greetd/ReGreet greeter -- see ../swaywm.nix -- so there is no tty1 autostart.
{ pkgs, ... }: {
pkgs,
config,
inputs,
username,
...
}:
{ {
imports = [ imports = [
./sway.nix ./sway.nix
@@ -27,6 +33,13 @@
# design, so no separate prefer-dark hint is needed. # design, so no separate prefer-dark hint is needed.
gtk = { gtk = {
enable = true; enable = true;
# Theme GTK4 apps too (for any added later). GTK4 ignores gtk-theme-name,
# but home-manager turns this into an `@import` of the theme's
# gtk-4.0/gtk.css into ~/.config/gtk-4.0/gtk.css -- which even libadwaita
# honours, since that file overrides the named colours it uses
# (window_bg_color, accent_bg_color, ...). Set explicitly (same value as the
# legacy default) so it also silences the stateVersion<26.05 warning.
gtk4.theme = config.gtk.theme;
theme = { theme = {
name = "catppuccin-mocha-blue-standard"; name = "catppuccin-mocha-blue-standard";
package = pkgs.catppuccin-gtk.override { package = pkgs.catppuccin-gtk.override {
@@ -50,4 +63,31 @@
name = "Adwaita"; name = "Adwaita";
size = 24; 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;
};
};
};
} }