Files
dotfiles/home/theme.nix
T
2026-09-23 00:29:45 +05:00

62 lines
1.8 KiB
Nix

# Dark theme for GTK and Qt apps.
#
# There is no desktop environment on this machine to hand apps a theme, so
# every toolkit has to be told separately:
#
# GTK2 ~/.gtkrc-2.0 + GTK2_RC_FILES -- adw-gtk3 has no GTK2 variant, so
# old apps get Adwaita-dark from gnome-themes-extra instead.
# GTK3 gtk-3.0/settings.ini (gtk-theme-name + prefer-dark).
# GTK4 libadwaita apps ignore gtk-theme-name; they follow the
# color-scheme=prefer-dark that the gtk3 module also writes into
# dconf, which is why programs.dconf.enable is on system-side.
# Electron/ Chromium, Brave, Firefox and friends ask the settings portal for
# browsers color-scheme, and xdg-desktop-portal-gtk answers from that same
# dconf key.
# Qt5/Qt6 qt5ct/qt6ct, because nixpkgs builds qtbase without the qgtk3
# platform theme (withGtk3 = false), so QT_QPA_PLATFORMTHEME=gtk3
# would silently do nothing.
{ pkgs, ... }:
{
gtk = {
enable = true;
colorScheme = "dark";
theme = {
name = "adw-gtk3-dark";
package = pkgs.adw-gtk3;
};
iconTheme = {
name = "Adwaita";
package = pkgs.adwaita-icon-theme;
};
gtk2.theme = {
name = "Adwaita-dark";
package = pkgs.gnome-themes-extra;
};
};
qt = {
enable = true;
platformTheme.name = "qtct";
# Pulls adwaita-qt{,6} in without setting QT_STYLE_OVERRIDE -- that
# variable makes qt5ct/qt6ct skip their own config entirely.
style.package = [ pkgs.adwaita-qt pkgs.adwaita-qt6 ];
qt5ctSettings.Appearance = {
style = "Adwaita-Dark";
icon_theme = "Adwaita";
standard_dialogs = "xdgdesktopportal";
};
qt6ctSettings.Appearance = {
style = "Adwaita-Dark";
icon_theme = "Adwaita";
standard_dialogs = "xdgdesktopportal";
};
};
}