catppuccin / nix

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

How do I override `catppuccin.sources`? #355

Closed budimanjojo closed 1 month ago

budimanjojo commented 1 month ago

Hello, I'm trying to use the latest catppuccin/tmux source. But it doesn't seem to work. What I have done in my home-manager configuration:

config.catppuccin.sources.tmux = {
  type = "Git";
  url = "https://github.com/catppuccin/tmux/archive/c3fab98ab4248a2a78c8193ad48f0991b7bfa1e3.tar.gz";
  revision = "c3fab98ab4248a2a78c8193ad48f0991b7bfa1e3";
  hash = "";
};

I was hoping that it will ask me to change the hash or something but it didn't. And the generated nix store is still using the ref from this repo. I checked the source code of mkGitSource here: https://github.com/catppuccin/nix/blob/96cf8b4a05fb23a53c027621b1147b5cf9e5439f/.sources/default.nix#L24-L46 and it seems like hash is not used for Git, so I changed the type to GitRelease and it still doesn't take my source. Is there something that I miss? Thanks before!

uncenter commented 1 month ago

I believe you want to use pkgs.fetchFromGitHub to fetch a different source here:

config.catppuccin.sources.tmux = pkgs.fetchFromGitHub {
  owner = "catppuccin";
  repo = "tmux";
  revision = "c3fab98ab4248a2a78c8193ad48f0991b7bfa1e3";
  hash = "";
};

When you run this at first it will warn you about a hash mismatch since the hash is empty, you can just put the suggested hash in and then build again.

budimanjojo commented 1 month ago

Thanks! Yes it works!