-
Notifications
You must be signed in to change notification settings - Fork 34
/
mkDarwinSystem.nix
59 lines (53 loc) · 1.53 KB
/
mkDarwinSystem.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
inputs:
{
username,
fullName,
email,
nixConfigDirectory, # directory on the system where this flake is located
system ? "aarch64-darwin",
# `nix-darwin` modules to include
modules ? [ ],
# Additional `nix-darwin` modules to include, useful when reusing a configuration with
# `lib.makeOverridable`.
extraModules ? [ ],
# Value for `home-manager`'s `home.stateVersion` option.
homeStateVersion,
# `home-manager` modules to include
homeModules ? [ ],
# Additional `home-manager` modules to include, useful when reusing a configuration with
# `lib.makeOverridable`.
extraHomeModules ? [ ],
}:
inputs.darwin.lib.darwinSystem {
inherit system;
modules =
modules
++ extraModules
++ [
inputs.home-manager.darwinModules.home-manager
(
{ config, ... }:
{
users.primaryUser = {
inherit
username
fullName
email
nixConfigDirectory
;
};
# Support legacy workflows that use `<nixpkgs>` etc.
nix.nixPath.nixpkgs = "${inputs.nixpkgs-unstable}";
# `home-manager` config
users.users.${username}.home = "/Users/${username}";
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${username} = {
imports = homeModules ++ extraHomeModules;
home.stateVersion = homeStateVersion;
home.user-info = config.users.primaryUser;
};
}
)
];
}