-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
102 lines (98 loc) · 3.02 KB
/
flake.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{
description = "Home server cluster deployment";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-24.05";
};
deploy-rs.url = "github:serokell/deploy-rs";
};
outputs = { self, nixpkgs, deploy-rs, ... }@inputs:
let
inherit (self) outputs;
specialArgs = {
inherit inputs outputs;
};
in
{
overlays = import ./overlays { inherit inputs; };
nixosConfigurations = {
cl-01 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit specialArgs;
modules = [ ./hosts/cl-01/configuration.nix ];
};
cl-02 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit specialArgs;
modules = [ ./hosts/cl-02/configuration.nix ];
};
cl-03 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit specialArgs;
modules = [ ./hosts/cl-03/configuration.nix ];
};
cl-04 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit specialArgs;
modules = [ ./hosts/cl-04/configuration.nix ];
};
cl-05 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit specialArgs;
modules = [ ./hosts/cl-05/configuration.nix ];
};
cl-06 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
inherit specialArgs;
modules = [ ./hosts/cl-06/configuration.nix ];
};
};
deploy = {
sshUser = "cluser";
sshOpts = [ "-A" ];
user = "root";
interactiveSudo = false;
magicRollback = false;
autoRollback = false;
nodes = {
cl-01 = {
hostname = "cl-01";
profiles.system = {
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cl-01;
};
};
cl-02 = {
hostname = "cl-02";
profiles.system = {
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cl-02;
};
};
cl-03 = {
hostname = "cl-03";
profiles.system = {
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cl-03;
};
};
cl-04 = {
hostname = "cl-04";
profiles.system = {
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cl-04;
};
};
cl-05 = {
hostname = "cl-05";
profiles.system = {
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cl-05;
};
};
cl-06 = {
hostname = "cl-06";
profiles.system = {
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.cl-06;
};
};
};
};
checks = builtins.mapAttrs (_system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
};
}