-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake-module.nix
57 lines (54 loc) · 1.34 KB
/
flake-module.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
{ inputs, ... }:
let
commonProfiles = with inputs.self.nixosModules; [
profiles-agenix
profiles-cachix-deploy
profiles-docs
profiles-misc
profiles-nix-nixpkgs
profiles-security
profiles-ssh
profiles-tailscale
profiles-users
];
commonHome = [
inputs.home-manager.nixosModule
{
home-manager = {
useGlobalPkgs = true;
extraSpecialArgs = { inherit inputs; };
users.kranzes = import ../home/kranzes;
};
}
];
nixosSystemWithDefaults = args: (inputs.nixpkgs.lib.nixosSystem ((builtins.removeAttrs args [ "hostName" ]) // {
specialArgs = { inherit inputs; } // args.specialArgs or { };
modules = [
./${args.hostName}
{ networking = { inherit (args) hostName; }; }
] ++ commonProfiles ++ (args.modules or [ ]);
}));
in
{
flake.nixosConfigurations = {
pongo = nixosSystemWithDefaults {
system = "x86_64-linux";
hostName = "pongo";
modules = commonHome;
};
gorilla = nixosSystemWithDefaults {
system = "x86_64-linux";
hostName = "gorilla";
modules = commonHome;
};
pan = nixosSystemWithDefaults {
system = "x86_64-linux";
hostName = "pan";
modules = commonHome;
};
hetzner = nixosSystemWithDefaults {
system = "x86_64-linux";
hostName = "hetzner";
};
};
}