diff --git a/modules/misc/gtk.nix b/modules/misc/gtk.nix index 2409376cb6e6..99e0bfddf44e 100644 --- a/modules/misc/gtk.nix +++ b/modules/misc/gtk.nix @@ -59,7 +59,7 @@ in theme = mkOption { type = types.nullOr themeType; default = null; - description = "Default theme for all GTK versions."; + description = "Default theme for GTK 2/3."; }; iconTheme = mkOption { diff --git a/modules/misc/gtk/gtk4.nix b/modules/misc/gtk/gtk4.nix index 7e5c4f0bc9d3..e140c2689d32 100644 --- a/modules/misc/gtk/gtk4.nix +++ b/modules/misc/gtk/gtk4.nix @@ -45,9 +45,12 @@ in packageExample = "pkgs.gnome.gnome-themes-extra"; } ); - default = cfg.theme; - defaultText = literalExpression "config.gtk.theme"; - description = "Theme for GTK 4 applications."; + default = null; + description = '' + Theme for GTK 4 applications. + + Warning: This is not officially supported and applied using a workaround, and may cause issues. + ''; }; iconTheme = mkOption { diff --git a/modules/misc/news/2025/09/2025-09-17_12-26-31.nix b/modules/misc/news/2025/09/2025-09-17_12-26-31.nix new file mode 100644 index 000000000000..b859bd010f64 --- /dev/null +++ b/modules/misc/news/2025/09/2025-09-17_12-26-31.nix @@ -0,0 +1,10 @@ +{ + time = "2025-09-17T10:26:31+00:00"; + condition = true; + message = '' + The option 'gtk.theme' does not apply to GTK 4 automatically anymore. Using a + custom theme is not officially supported by GTK 4, and is implemented by + home-manager using a workaround that may cause issues in some cases. If you + still want to use a GTK 4 theme, you need to explicitly set 'gtk.gtk4.theme'. + ''; +} diff --git a/tests/modules/misc/gtk/gtk-global-inheritance-gtk4-css-expected.css b/tests/modules/misc/gtk/gtk-global-inheritance-gtk4-css-expected.css deleted file mode 100644 index a8f04a5ca3f8..000000000000 --- a/tests/modules/misc/gtk/gtk-global-inheritance-gtk4-css-expected.css +++ /dev/null @@ -1,5 +0,0 @@ -/** - * GTK 4 reads the theme configured by gtk-theme-name, but ignores it. - * It does however respect user CSS, so import the theme from here. -**/ -@import url("file://@gnome-themes-extra@/share/themes/Adwaita-dark/gtk-4.0/gtk.css"); diff --git a/tests/modules/misc/gtk/gtk-global-inheritance-gtk4-expected.ini b/tests/modules/misc/gtk/gtk-global-inheritance-gtk4-expected.ini index 8e08f8d5d2be..68697d618fce 100644 --- a/tests/modules/misc/gtk/gtk-global-inheritance-gtk4-expected.ini +++ b/tests/modules/misc/gtk/gtk-global-inheritance-gtk4-expected.ini @@ -5,4 +5,3 @@ gtk-cursor-theme-size=24 gtk-font-name=Ubuntu 12 gtk-icon-theme-name=Adwaita gtk-interface-color-scheme=2 -gtk-theme-name=Adwaita-dark diff --git a/tests/modules/misc/gtk/gtk-global-inheritance.nix b/tests/modules/misc/gtk/gtk-global-inheritance.nix index 3d01f4843963..bcb73007a153 100644 --- a/tests/modules/misc/gtk/gtk-global-inheritance.nix +++ b/tests/modules/misc/gtk/gtk-global-inheritance.nix @@ -37,9 +37,5 @@ assertFileExists home-files/.config/gtk-4.0/settings.ini assertFileContent home-files/.config/gtk-4.0/settings.ini \ ${./gtk-global-inheritance-gtk4-expected.ini} - - # Check GTK4 CSS with theme import - assertFileExists home-files/.config/gtk-4.0/gtk.css - assertFileContent home-files/.config/gtk-4.0/gtk.css ${./gtk-global-inheritance-gtk4-css-expected.css} ''; } diff --git a/tests/modules/misc/gtk/gtk-per-version-override-gtk4-expected.ini b/tests/modules/misc/gtk/gtk-per-version-override-gtk4-expected.ini index 25b6ea043061..33c58e970156 100644 --- a/tests/modules/misc/gtk/gtk-per-version-override-gtk4-expected.ini +++ b/tests/modules/misc/gtk/gtk-per-version-override-gtk4-expected.ini @@ -3,4 +3,3 @@ gtk-cursor-theme-name=Global-Cursor gtk-font-name=GTK4-Font 11 gtk-icon-theme-name=Global-Icons gtk-recent-files-limit=20 -gtk-theme-name=Global-Theme diff --git a/tests/modules/misc/gtk/gtk-per-version-override.nix b/tests/modules/misc/gtk/gtk-per-version-override.nix index 0273de70949c..4881f86e1948 100644 --- a/tests/modules/misc/gtk/gtk-per-version-override.nix +++ b/tests/modules/misc/gtk/gtk-per-version-override.nix @@ -46,7 +46,7 @@ assertFileContent home-files/.config/gtk-3.0/gtk.css \ ${./gtk-per-version-override-gtk3-css-expected.css} - # GTK4 should use overridden font, global theme/icons/cursor + # GTK4 should use overridden font, global icons/cursor assertFileExists home-files/.config/gtk-4.0/settings.ini assertFileContent home-files/.config/gtk-4.0/settings.ini \ ${./gtk-per-version-override-gtk4-expected.ini} diff --git a/tests/modules/misc/gtk/gtk4/gtk4-basic-settings.nix b/tests/modules/misc/gtk/gtk4/gtk4-basic-settings.nix index 101cb0258564..874ce09afc56 100644 --- a/tests/modules/misc/gtk/gtk4/gtk4-basic-settings.nix +++ b/tests/modules/misc/gtk/gtk4/gtk4-basic-settings.nix @@ -2,11 +2,11 @@ { gtk = { enable = true; - theme = { - name = "catppuccin-macchiato-blue-standard"; - package = pkgs.catppuccin-gtk; - }; gtk4 = { + theme = { + name = "catppuccin-macchiato-blue-standard"; + package = pkgs.catppuccin-gtk; + }; extraConfig = { gtk-cursor-blink = false; gtk-recent-files-limit = 20;