catppuccin / gtk

🪟 Soothing pastel theme for GTK3/4
GNU General Public License v3.0
913 stars 54 forks source link

Setting config for GTK-4 Attribute missing #167

Closed Schlentzen closed 6 months ago

Schlentzen commented 7 months ago

Describe the bug When i set the config for nix i get the error: error: attribute 'theme' missing at

 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";
  };

Mention your distribution and your theme version NixOS 23.11

Select how you installed the theme

Symlinked the gtk-4.0 folder? Have you symlinked the gtk-4.0 folder as mentioned in the README? This is not applicable for users who have installed the theme with the Nixpkg. I try

HomeManager is installed as a module like this:

 imports =
    [
      # Include the results of the hardware scan.
      ./hardware-configuration.nix
      <home-manager/nixos>
    ];
home-manager.users.username = {
    home.stateVersion = "23.11";
    imports = [ ./dconf.nix ];
    gtk = {
      enable = true;
      theme = {
        name = "Catppuccin-Macchiato-Compact-Pink-Dark";
        package = pkgs.catppuccin-gtk.override {
          accents = [ "pink" ];
          size = "compact";
          tweaks = [ "rimless" "black" ];
          variant = "macchiato";
        };
      };
    };
    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";
    };
  };
Schlentzen commented 7 months ago

Found the error, it had to be:

home-manager.users.username ={ config, pkgs, ... }: {

kualta commented 7 months ago

can confirm, this fixes the issue. thanks @Schlentzen! I think this can be closed after updating the docs in the readme