Skip to content

Separate system from home-manager config to allow individual switches #5

@f4z3r

Description

@f4z3r

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions