Home Manager Different Flake location

I am trying to set up a ~/nix directory linked to this github repo: GitHub - mars-monkey/nix. However, when I run home-manager switch --flake ~/nix/home#"mars-monkey", it gives the following error:

error: getting status of '/nix/store/9spbll1al33y6a46s7fssgrv97a6dvis-source/home': No such file or directory

If it makes any difference, I am running a standalone installation of Home Manager but I have installed the home-manager package in my main configuration.nix file, rather than in my profile.

I also tried using home-manager init with the new directory, but it still didn’t work.
For reference, when I run home-manager switch --flake ~/.config/home-manager#"mars-monkey", it works fine.

If you have ~/nix/flake.nix you need to call it as home-manager switch --flake ~/nix#mars-monkey.

1 Like

It’s ~/nix/home/flake.nix, so I called it as home-manager switch --flake ~/nix/home#"mars-monkey"

Is the problem the quotes?

I tested it and yes, the quotes were the problem. Thanks!