You can split the NixOS and home-manager configuration as follows:
outputs =
{
nixpkgs,
home-manager,
...
}:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
./system.nix
];
};
homeConfigurations.f4z3r = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home ];
};
};
}
This no only clearly separates the user configuration from the system configuration, it also ensures that these can be built individually. This is nice for faster build times, and better integrations with tools such as nh.