I just had this issue. Are your versions of home-manager and NixOS mismatched?
I’m running NixOS 24.11 but using the latest home-manager. It seems like a recent update to home-manager broke compatibility with NixOS 24.11.
I pinned mine to the last home-manager commit with:
home-manager = {
url = "github:nix-community/home-manager/0b491b460f52e87e23eb17bbf59c6ae64b7664c1";
inputs.nixpkgs.follows = "nixpkgs";
};
If you’re not intentionally using the latest version of home-manager, replace the commit hash with your NixOS version.