flocon/home/programs/gtk.nix
Anthony Rodriguez 32971e91bf
treewide: theme module refactor
I decided to refactor how the theme module works. The idea is, that I
wanted originally a module that I could give a base16 scheme name to,
and use that globally in my config. However, scheme only took the base16
scheme name without any checks, which was pretty bad. I ended up
creating a new option, schemeName, that scheme is computed from. It then
makes the whole configuration cleaner, and avoids long inputs
interpolations with the scheme name.
2024-11-21 15:51:01 +01:00

52 lines
1,022 B
Nix

{
pkgs,
config,
osConfig,
lib,
...
}: let
isDark = osConfig.theme.scheme.variant == "dark";
in {
home.pointerCursor = {
inherit (osConfig.theme.cursorTheme) name package size;
gtk.enable = true;
x11.enable = true;
};
gtk = {
enable = true;
font = {
name = "Inter";
package = pkgs.inter;
size = 11;
};
gtk3.extraConfig = {
gtk-decoration-layout = ":menu";
gtk-application-prefer-dark-theme = isDark;
};
gtk4.extraConfig = {
gtk-decoration-layout = ":menu";
};
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
iconTheme = {
inherit (osConfig.theme.gtk.iconTheme) name package;
};
theme = lib.mkIf (!osConfig.services.xserver.desktopManager.gnome.enable) {
inherit (osConfig.theme.gtk.theme) name package;
};
};
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme =
if isDark
then "prefer-dark"
else "default";
};
};
}