i’ve got a fairly simple system running nixos 24.05. it’s a basic install - no flakes, just a configuration.nix file.
i’d like the users on this system to be able to manage their home directories using the home-manager command. so i am not installing home-manager as a nixos module.
instead, i’m adding pkgs.home-manager to environment.systemPackages in my configuration.nix file, like this:
environment.systemPackages = with pkgs; [
<some packages>
home-manager
<more packages>
];
this install seems to work, and the home-manager command is available to all users. when a user runs home-manager init, the config file is created in ~/.config/home-manager/home.nix
two weird things to note at this point…
- the fresh
home.nixfile hashome.stateVersion = "23.11"; - running
home-manager --versionreports24.05pre
the user can now edit their home.nix and switch to it via home-manager switch. and the changes stick. for example, they can add pkgs.hello to home.packages, and after running home-manager switch, the hello command is available.
but at this point, the home-manager switch command will no longer run. it returns the following error…
error: file 'home-manager/home-manager/home-manager.nix' was not found in the Nix search path (add it using $NIX_PATH or -I)
at «none»:0: (source not available)
other home-manager subcommands like edit and packages work fine. the build subcommand returns the error above.
i’ve searched for solutions to this error.
this issue seems to indicate that a fix was made to nixpkgs was made a year ago. it also mentions a workaround tweak to home-manager.overrideAttrs but i have no idea where that change would go (sorry i’m a nix newb).
in this issue, folks focus on the home-manager channel being used. i can’t tell which one i’m using… i would expect that adding the home-manager package to my configuration.nix would pick the correct version.
this pull request seems related, and it’s from three months ago. i’m guessing i would need to pull the home-manager package from a more recent channel or tarball, but i don’t see any nixos examples of how to do that.
what am i missing?