diff --git a/modules/home-manager/gtk.nix b/modules/home-manager/gtk.nix index 9e264dbd..c18fce8e 100644 --- a/modules/home-manager/gtk.nix +++ b/modules/home-manager/gtk.nix @@ -30,46 +30,48 @@ in }; }; - config.gtk = lib.mkIf enable { - theme = - let - flavourUpper = ctp.mkUpper cfg.flavour; - accentUpper = ctp.mkUpper cfg.accent; - sizeUpper = ctp.mkUpper cfg.size; + config = lib.mkIf enable { + gtk = { + theme = + let + flavourUpper = ctp.mkUpper cfg.flavour; + accentUpper = ctp.mkUpper cfg.accent; + sizeUpper = ctp.mkUpper cfg.size; - # use the light gtk theme for latte - gtkTheme = - if cfg.flavour == "latte" - then "Light" - else "Dark"; - in - { - name = "Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}"; - package = pkgs.catppuccin-gtk.override { - inherit (cfg) size tweaks; - accents = [ cfg.accent ]; - variant = cfg.flavour; + # use the light gtk theme for latte + gtkTheme = + if cfg.flavour == "latte" + then "Light" + else "Dark"; + in + { + name = "Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}"; + package = pkgs.catppuccin-gtk.override { + inherit (cfg) size tweaks; + accents = [ cfg.accent ]; + variant = cfg.flavour; + }; }; - }; - cursorTheme = - let - flavourUpper = ctp.mkUpper cfg.cursor.flavour; - accentUpper = ctp.mkUpper cfg.cursor.accent; - in - lib.mkIf cfg.cursor.enable { - name = "Catppuccin-${flavourUpper}-${accentUpper}-Cursors"; - package = pkgs.catppuccin-cursors.${cfg.cursor.flavour + accentUpper}; - }; - }; + cursorTheme = + let + flavourUpper = ctp.mkUpper cfg.cursor.flavour; + accentUpper = ctp.mkUpper cfg.cursor.accent; + in + lib.mkIf cfg.cursor.enable { + name = "Catppuccin-${flavourUpper}-${accentUpper}-Cursors"; + package = pkgs.catppuccin-cursors.${cfg.cursor.flavour + accentUpper}; + }; + }; - config.assertions = [ - (lib.ctp.assertXdgEnabled "gtk") - ]; + assertions = [ + (lib.ctp.assertXdgEnabled "gtk") + ]; - config.xdg.configFile = lib.mkIf enable { - "gtk-4.0/assets".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/assets"; - "gtk-4.0/gtk.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk.css"; - "gtk-4.0/gtk-dark.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk-dark.css"; + xdg.configFile = { + "gtk-4.0/assets".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/assets"; + "gtk-4.0/gtk.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk.css"; + "gtk-4.0/gtk-dark.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk-dark.css"; + }; }; }