-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflakeHelpers.nix
72 lines (71 loc) · 2.25 KB
/
flakeHelpers.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
inputs:
let
homeManagerCfg = userPackages: extraImports: {
home-manager.useGlobalPkgs = false;
home-manager.extraSpecialArgs = {
inherit inputs;
};
home-manager.users.notthebee.imports = [
inputs.agenix.homeManagerModules.default
inputs.nix-index-database.hmModules.nix-index
./users/notthebee/dots.nix
./users/notthebee/age.nix
] ++ extraImports;
home-manager.backupFileExtension = "bak";
home-manager.useUserPackages = userPackages;
};
in
{
mkDarwin = machineHostname: nixpkgsVersion: extraHmModules: extraModules: {
darwinConfigurations.${machineHostname} = inputs.nix-darwin.lib.darwinSystem {
system = "aarch64-darwin";
specialArgs = {
inherit inputs;
};
modules = [
"${inputs.secrets}/default.nix"
inputs.agenix.darwinModules.default
./machines/darwin
./machines/darwin/${machineHostname}
inputs.home-manager.darwinModules.home-manager
(inputs.nixpkgs.lib.attrsets.recursiveUpdate (homeManagerCfg true extraHmModules) {
home-manager.users.notthebee.home.homeDirectory = inputs.nixpkgs.lib.mkForce "/Users/notthebee";
})
];
};
};
mkNixos = machineHostname: nixpkgsVersion: extraModules: rec {
deploy.nodes.${machineHostname} = {
hostname = machineHostname;
profiles.system = {
user = "root";
sshUser = "notthebee";
path = inputs.deploy-rs.lib.x86_64-linux.activate.nixos nixosConfigurations.${machineHostname};
};
};
nixosConfigurations.${machineHostname} = nixpkgsVersion.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
vars = import ./machines/nixos/vars.nix;
};
modules = [
./homelab
./machines/nixos/_common
./machines/nixos/${machineHostname}
./modules/email
./modules/tg-notify
./modules/duckdns
./modules/auto-aspm
./modules/mover
"${inputs.secrets}/default.nix"
inputs.agenix.nixosModules.default
./users/notthebee
(homeManagerCfg false [ ])
] ++ extraModules;
};
};
mkMerge = inputs.nixpkgs.lib.lists.foldl' (
a: b: inputs.nixpkgs.lib.attrsets.recursiveUpdate a b
) { };
}