2023-08-09 02:13:02 +00:00
|
|
|
{ config, pkgs, lib, ... }: {
|
2023-08-06 22:07:47 +00:00
|
|
|
|
2023-08-09 02:13:02 +00:00
|
|
|
options = {
|
|
|
|
gtk.theme = {
|
|
|
|
name = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
description = "Theme name for GTK applications";
|
|
|
|
};
|
|
|
|
package = lib.mkOption {
|
|
|
|
type = lib.types.package;
|
|
|
|
description = "Theme package for GTK applications";
|
|
|
|
default = pkgs.gnome-themes-extra;
|
|
|
|
};
|
2023-08-06 22:07:47 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf config.gui.enable {
|
|
|
|
|
|
|
|
home-manager.users.${config.user} = {
|
|
|
|
|
|
|
|
gtk = let
|
|
|
|
gtkExtraConfig = {
|
|
|
|
gtk-application-prefer-dark-theme = config.theme.dark;
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
enable = true;
|
|
|
|
theme = {
|
2023-08-09 02:13:02 +00:00
|
|
|
name = config.gtk.theme.name;
|
|
|
|
package = config.gtk.theme.package;
|
2023-08-06 22:07:47 +00:00
|
|
|
};
|
|
|
|
gtk3.extraConfig = gtkExtraConfig;
|
|
|
|
gtk4.extraConfig = gtkExtraConfig;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2023-08-09 02:13:02 +00:00
|
|
|
# Required for setting GTK theme (for preferred-color-scheme in browser)
|
|
|
|
services.dbus.packages = [ pkgs.dconf ];
|
|
|
|
programs.dconf.enable = true;
|
|
|
|
|
2023-08-06 22:07:47 +00:00
|
|
|
# Make the login screen dark
|
|
|
|
services.xserver.displayManager.lightdm.greeters.gtk.theme = {
|
2023-08-09 02:13:02 +00:00
|
|
|
name = config.gtk.theme.name;
|
|
|
|
package = config.gtk.theme.package;
|
2023-08-06 22:07:47 +00:00
|
|
|
};
|
|
|
|
|
2023-08-09 02:13:02 +00:00
|
|
|
environment.sessionVariables = { GTK_THEME = config.gtk.theme.name; };
|
2023-08-06 22:07:47 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|