-
Notifications
You must be signed in to change notification settings - Fork 1
/
hive.nix
95 lines (87 loc) · 2.71 KB
/
hive.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
inputs@{ self, srvos, nixpkgs, cottand, home-manager, utils, attic, overlays, ... }:
let
secretPath = "/Users/nico/dev/cottand/selfhosted/secret/";
mkNodePool = { names, module, ... }: builtins.listToAttrs (builtins.map
(name: {
inherit name;
value = module;
})
names);
in
{
meta = {
nixpkgs = nixpkgs.legacyPackages.x86_64-linux;
specialArgs.secretPath = secretPath;
specialArgs.flakeInputs = inputs;
};
defaults = { pkgs, lib, name, nodes, meta, config, ... }: {
imports = [
./machines/_default
./machines/modules
home-manager.nixosModules.home-manager
cottand.nixosModules.seaweedBinaryCache
cottand.nixosModules.dcottaRootCa
];
nixpkgs = {
inherit overlays;
system = lib.mkDefault "x86_64-linux";
config.allowUnfree = true;
};
deployment.tags = [ config.nixpkgs.system ];
};
cosmo = { name, nodes, ... }: {
imports = [ ./machines/${name}/definition.nix ];
deployment.tags = [ "contabo" "nomad-server" ];
};
miki = { name, nodes, lib, ... }: {
imports = [ ./machines/${name}/definition.nix ];
deployment.tags = [ "contabo" "nomad-server" ];
};
ari = { name, nodes, ... }: {
imports = [ ./machines/${name}/definition.nix ];
deployment.tags = [ "local" "nomad-client" ];
};
xps2 = { name, nodes, ... }: {
imports = [ ./machines/${name}/definition.nix ];
deployment.tags = [ "local" "nomad-client" ];
};
bianco = { name, nodes, ... }: {
imports = [ ./machines/${name}/definition.nix ];
deployment.tags = [ "madrid" "nomad-client" ];
};
hez1 = { name, nodes, ... }: {
imports = [ ./machines/${name}/definition.nix ];
deployment.tags = [ "hetzner" ];
};
hez2 = { name, nodes, ... }: {
imports = [ ./machines/${name}/definition.nix ];
deployment.tags = [ "hetzner" ];
};
hez3 = { name, nodes, ... }: {
imports = [ ./machines/${name}/definition.nix ];
deployment.tags = [ "hetzner" ];
};
macMini1 = { name, nodes, ... }: {
imports = [ ./machines/${name}/definition.nix ];
deployment.tags = [ "local" "macmini" ];
};
gcp-worker-dfv7 = {
imports = [ ./machines/gcpWorker/definition.nix ];
deployment.tags = [ "gcp" ];
deployment.targetHost = "34.118.247.206";
};
gcp-worker-dw64 = {
imports = [ ./machines/gcpWorker/definition.nix ];
deployment.tags = [ "gcp" ];
deployment.targetHost = "35.234.68.55";
};
}
// (mkNodePool {
names = with builtins; fromJSON (readFile "${self}/terraform/metal/oci_control.json");
module = {
# hqsw has 1 core not 2
imports = [ ./machines/ociControlWorker srvos.nixosModules.server ];
deployment.tags = [ "oci-control" ];
deployment.buildOnTarget = false;
};
})