How to setup cachix for Hyprland

https://github.com/NamitBhutani/nixos-config
This is my config, I have setup cachix this way -

 nix = {
    settings = {
      auto-optimise-store = true;
      experimental-features = [ "nix-command" "flakes" ];
      substituters = ["https://hyprland.cachix.org"];
      trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
    };
    gc = {
      automatic = true;
      dates = "weekly";
      options = "--delete-older-than 7d";
    };
  };

I am on a flake setup with Hyprland input and nixos unstable input, whenever I do a flake update and build, it rebuilds Hyprland everytime and sometimes causes my laptop to overheat and crash, Thus I want to setup Cachix, but it doesn’t work with my current config.
Also any tips on pulling pre built binaries for updates would be appreciated, as I dont want to build all programs from scratch on every flake update.

tia :smiley:

Did you configure the binary cache and run nixos-rebuild before adding Hyprland itself to your config?

No, I had Hyprland installed before I added cachix, Should I remove Hyprland from the config first? Also do I need to install cachix as a program for this to work?

Cachix is a service for hosting Nix binary caches, by the looks of things you’ve already set it up.

I would have to guess that your Nix config doesn’t have the binary cache applied because it’s trying to apply that change alongside building Hyprland from source, although the fact that you already have Hyprland installed doesn’t really support that theory…

Hmm, let me explain it to you, I have been using my current config for a long time before I added cachix, so for every rebuild after adding cachix, Hyprland was already installed, do you think disabling Hyprland and rebuilding, and then enabling Hyprland should fix the problem?