-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystem.nix
77 lines (70 loc) · 1.71 KB
/
system.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
inputs,
user,
...
}:
let
inherit (inputs.nixpkgs.lib) nixosSystem;
in
{
mkHost =
{
system ? "x86_64-linux",
systemConfig,
userConfig ? { },
extraModules ? [ ],
}:
let
inherit (systemConfig.core) hostname;
pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.${system};
in
nixosSystem {
inherit system;
specialArgs = {
inherit inputs pkgs-unstable;
};
modules = [
(
{ config, ... }:
let
inherit (config.lajp.user) username;
inherit (config.lajp.core) server;
in
{
imports = [
../hosts/${hostname}
../modules/system
];
networking.hostName = hostname;
lajp = systemConfig;
home-manager =
if !server then
{
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inherit inputs pkgs-unstable;
};
users.${username} = user.mkConfig { inherit userConfig; };
}
else
{ };
}
)
inputs.home-manager.nixosModule
inputs.agenix.nixosModules.default
inputs.agenix-rekey.nixosModules.default
inputs.stylix.nixosModules.stylix
(
{ config, ... }:
{
age.rekey = {
masterIdentities = [ ../yubikey.pub ];
storageMode = "local";
localStorageDir = ../. + "/secrets/rekeyed/${config.networking.hostName}";
};
}
)
] ++ extraModules;
};
}