catppuccin / nix

❄️ Soothing pastel theme for Nix
https://nix.catppuccin.com/
MIT License
300 stars 45 forks source link

Catppuccin options don't exist #267

Closed TomAintAround closed 1 day ago

TomAintAround commented 2 days ago

Steps to reproduce

  1. Make sure you back up your personal home-manager configurations
  2. Add this flake.nix file to ~/.config/home-manager and replace the username and hostname with your own

    {
    description = "Home Manager configuration of tomm";
    
    inputs = {
    nixpkgs.url = "github:NixOs/nixpkgs/nixos-unstable";
    
    home-manager = {
      url = "github:nix-community/home-manager/master";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    
    catppuccin.url = "github:catppuccin/nix";
    };
    
    outputs = { self, nixpkgs, home-manager, catppuccin, ... }@inputs:
    let
    system = "x86_64-linux";
    pkgs = nixpkgs.legacyPackages.${system};
    specialArgs = inputs // { inherit system; };
    extraSpecialArgs = specialArgs;
    
    homeManagerConfig = home-manager.lib.homeManagerConfiguration;
    in {
    homeConfigurations = {
      "tomm@desktop" = homeManagerConfig {
        inherit pkgs extraSpecialArgs;
        modules = [
          catppuccin.homeManagerModules.catppuccin
          ./home.nix
        ];
      };
    };
    };
    }
  3. Add this flake.lock file to ~/.config/home-manager
    {
    "nodes": {
    "catppuccin": {
      "locked": {
        "lastModified": 1719758387,
        "narHash": "sha256-bMaI1jJNzIZar4TP/hhoPQROqqcbD6zT6O+sqIJdp8c=",
        "owner": "catppuccin",
        "repo": "nix",
        "rev": "9eb0610d48dd0e1fecf772bbdacf9050d7b82d7c",
        "type": "github"
      },
      "original": {
        "owner": "catppuccin",
        "repo": "nix",
        "type": "github"
      }
    },
    "home-manager": {
      "inputs": {
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1719677234,
        "narHash": "sha256-qO9WZsj/0E6zcK4Ht1y/iJ8XfwbBzq7xdqhBh44OP/M=",
        "owner": "nix-community",
        "repo": "home-manager",
        "rev": "36317d4d38887f7629876b0e43c8d9593c5cc48d",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "ref": "master",
        "repo": "home-manager",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1719506693,
        "narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=",
        "owner": "NixOs",
        "repo": "nixpkgs",
        "rev": "b2852eb9365c6de48ffb0dc2c9562591f652242a",
        "type": "github"
      },
      "original": {
        "owner": "NixOs",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "catppuccin": "catppuccin",
        "home-manager": "home-manager",
        "nixpkgs": "nixpkgs"
      }
    }
    },
    "root": "root",
    "version": 7
    }
  4. Add this home.nix file to ~/.config/home-manager and make sure to replace the username with your own

    { lib, ... }: {
    home = {
    username = "tomm";
    homeDirectory = lib.mkDefault "/home/tomm";
    stateVersion = "24.05";
    preferXdgDirectories = true;
    sessionVariables = {
       # XDG Dot Files
       XDG_CONFIG_HOME = "$HOME/.config";
       XDG_CACHE_HOME = "$HOME/.cache";
       XDG_DATA_HOME = "$HOME/.local/share";
       XDG_STATE_HOME = "$HOME/.local/state";
    
       # Default Apps
       OPENER = "nvim";
       VISUAl = "nvim";
       EDITOR = "nvim";
       PAGER = "bat --paging=always";
       READER =  "libreoffice --draw";
       BROWSER = "firefox";
    
       # Paths
       GOPATH = "$HOME/.local/share/go";
    };
    
    language =
    let
      en = "en_US.UTF-8";
    in {
      address = en;
      base = en;
      collate = en;
      ctype = en;
      measurement = en;
      messages = en;
      monetary = en;
      name = en;
      numeric = en;
      paper = en;
      telephone = en;
      time = en;
    };
    };
    
    programs = {
    home-manager.enable = true;
    alacritty = {
      enable = true;
    #      catppuccin = {
    #       enable = true;
    #       flavour = "mocha";
    #      };
    };
    };
    }
  5. Make sure you have home-manager installed. If not, run the command nix-shell -p home-manager
  6. Make sure the experimental features "nix-command" and "flakes" are enabled
  7. Run home-manager switch --flake ~/.config/home-manager. There should be no errors
  8. Uncomment the catppuccin options at the end of the home.nix file
  9. Run home-manager switch --flake ~/.config/home-manager again

Expected Result

Home-manager is set, Alacritty is installed and the catppuccin theme is set with no errors

Actual Result

Home-manager is set with no errors, Alacritty is installed, but home-manager doesn't recognize catppuccin options, throwing the following error message:

error:
       … while evaluating a branch condition

         at /nix/store/4p0avw1s3vf27hspgqsrqs37gxk4i83i-source/lib/lists.nix:125:9:

          124|       fold' = n:
          125|         if n == len
             |         ^
          126|         then nul

       … while calling the 'length' builtin

         at /nix/store/4p0avw1s3vf27hspgqsrqs37gxk4i83i-source/lib/lists.nix:123:13:

          122|     let
          123|       len = length list;
             |             ^
          124|       fold' = n:

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `programs.alacritty.catppuccin.flavour' does not exist. Definition values:
       - In `/nix/store/rx03f1hl4y9lz539wpw1llvg2gwdx15g-source/home.nix': "mocha"
vdbe commented 2 days ago

Have you tried programs.alacritty.catppuccin.flavor (flavour vs flavor)?

https://nix.catppuccin.com/options/home-manager-options.html?highlight=alacritty#programsalacrittycatppuccinflavor

TomAintAround commented 1 day ago

Yes it did work and I'm very sorry for this dumb issue. I'll close this and immediately go to bed and sleep 8 for hours for once