Home manager, flake and configuration. How to rebuild the whole environment with just nixos-rebuild switch?

To be more specific, they need to import home-manager NixOS module (e.g. add it to modules argument of nixosSystem), and then add the following NixOS option either to their configuration.nix or directly to modules argument of nixosSystem (wrapped in {} to make it a module):

  home-manager.users.${username} = {
    imports = [
      ./home.nix
    ];
  };

Actually, what you came up with in Add an option to home manager as a nixos module using flake - #2 by Peal is almost good.

1 Like