NixOS with flake not using hyprland cachix

Hello,
I manage my NixOS and home-manager config in a flake.
I want to use the Hyprland flake, so I added these lines to my configuration.nix:

nix.settings = {
  trusted-users = ["railwhale"];
  substituters = ["https://hyprland.cachix.org" "https://cache.nixos.org"];
  trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};

And set Hyprland’s package:

{ inputs, system, ... }: {
  programs.hyprland = {
    enable = true;
    package = inputs.hyprland.packages.${system}.hyprland;
  };
}

However, when I run nixos-rebuild, It tells me it’s building Xwayland, XDPH, or another Hyprland thing.
I have tried setting substitutors and trusted-public-keys in my flake.nix using nixConfig. I confirmed that I wanted to use those settings, and it still didn’t use the cache.

My configuration.nix
My Hyprland block
My flake.nix

You need to add the new cache in one step, activate that, then add the new stuff in another step; then try to build/activate.

In other words, the new cache you added won’t be effective until a generation with it is activated. It sounds like you’re adding the new software and the cache at the same time, which would cause what you’re describing.

1 Like