about summary refs log tree commit diff
path: root/lib/mk_home.nix
blob: 52acc96f1a8199cde73d20af4dcf412db85984f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ self, home-manager, ... } @ inputs:

{ username, hostname, system, pkgs, version, extraModules }:
let
  args = inputs;
  entrypoint = "${self}/home/${hostname}/${username}.nix";
in
home-manager.lib.homeManagerConfiguration {
  inherit username system;
  homeDirectory = "/home/${username}";
  stateVersion = version;
  pkgs = pkgs;

  configuration = { lib, ... }: {
    _module = { inherit args; };

    profiles.base.enable = true;

    imports = [
      entrypoint
    ] ++ lib.optionals (extraModules != null) extraModules;
  };
}