Home-manager not installed through nix build

Hey folks,

I’m using flakes to define nixosSystem configurations which I then use to create virtual machines with ‘nix build […]build.vm’

In my nixosConfiguration I’m importing home-manager and have defined ‘home-manager.users..home.programs.home-manager.enable = true’

I was expecting that as result ‘home-manager’ would be installed for my user and that ‘~/.config/nixpkgs/home-manager’ would be setup, but neither ‘home-manager’ is available nor that directory exists.

Any ideas on what could be wrong or how to troubleshoot? Many thanks in advance

Assuming that this means you’re using home-manager as a NixOS module, you can see here that this sets config.submoduleSupport = true, and in turn here you can see that the home-manager program is installed only if config.submoduleSupport = false, or in other words, only if you are using home-manager standalone.

You’re right about the usage of the NixOS module.

Many thanks for clarifying and pointing to the sauce. I totally misinterpreted the documentation.