-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.nix
56 lines (54 loc) · 1.14 KB
/
lib.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
{
self,
nixpkgs,
home-manager,
templates,
}: {
mkHost = {
system,
stateVersion,
imports ? [],
modules ? [],
specialArgs ? {},
specialHomeArgs ? {},
homes ? {},
}:
nixpkgs.lib.nixosSystem {
inherit system specialArgs;
modules =
[
{
system.stateVersion = stateVersion;
inherit imports;
}
home-manager.nixosModules.home-manager
{
# maybe ? https://github.com/nix-community/home-manager/issues/2701
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = specialHomeArgs;
home-manager.users = homes;
}
]
++ modules;
};
mkHome = {
username,
homeDirectory ?
if username == "root"
then "/root"
else "/home/${username}",
stateVersion,
imports ? [],
}: {
home = {
inherit username stateVersion homeDirectory;
};
nix.registry = {
self.flake = self;
nixpkgs.flake = nixpkgs;
templates.flake = templates;
};
inherit imports;
};
}