diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-01-05 17:08:32 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-01-05 17:08:32 +0100 |
commit | e820134d38c3b7470ea5112f40a6dc967f039878 (patch) | |
tree | f05a5cefe285d060aa0ebf52829bcfcd35549f8b /modules/private/system | |
parent | b22ce4895ef1e9723a02061f7293e528cfbf9754 (diff) | |
download | Nix-e820134d38c3b7470ea5112f40a6dc967f039878.tar.gz Nix-e820134d38c3b7470ea5112f40a6dc967f039878.tar.zst Nix-e820134d38c3b7470ea5112f40a6dc967f039878.zip |
Add monitoring host
Diffstat (limited to 'modules/private/system')
-rw-r--r-- | modules/private/system/monitoring-1.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/modules/private/system/monitoring-1.nix b/modules/private/system/monitoring-1.nix new file mode 100644 index 0000000..1460478 --- /dev/null +++ b/modules/private/system/monitoring-1.nix | |||
@@ -0,0 +1,41 @@ | |||
1 | { privateFiles }: | ||
2 | { config, pkgs, resources, ... }: | ||
3 | { | ||
4 | boot.kernelPackages = pkgs.linuxPackages_latest; | ||
5 | myEnv = import "${privateFiles}/environment.nix" // { inherit privateFiles; }; | ||
6 | hostEnv.FQDN = "monitoring-1.v.immae.eu"; | ||
7 | |||
8 | imports = builtins.attrValues (import ../..); | ||
9 | |||
10 | deployment = { | ||
11 | targetEnv = "hetznerCloud"; | ||
12 | hetznerCloud = { | ||
13 | authToken = config.myEnv.hetznerCloud.authToken; | ||
14 | datacenter = "hel1-dc2"; | ||
15 | location ="hel1"; | ||
16 | serverType = "cx11"; | ||
17 | }; | ||
18 | }; | ||
19 | |||
20 | myServices.monitoring.enable = true; | ||
21 | myServices.monitoring.master = true; | ||
22 | myServices.status.enable = true; | ||
23 | networking = { | ||
24 | firewall.enable = true; | ||
25 | interfaces."ens3".ipv4.addresses = pkgs.lib.attrsets.mapAttrsToList | ||
26 | (n: ips: { address = ips.ip4; prefixLength = 32; }) | ||
27 | (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") config.myEnv.servers.monitoring-1.ips); | ||
28 | interfaces."ens3".ipv6.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList | ||
29 | (n: ips: map (ip: { address = ip; prefixLength = (if n == "main" && ip == pkgs.lib.head ips.ip6 then 64 else 128); }) (ips.ip6 or [])) | ||
30 | config.myEnv.servers.monitoring-1.ips); | ||
31 | defaultGateway6 = { address = "fe80::1"; interface = "ens3"; }; | ||
32 | }; | ||
33 | myServices.mailRelay.enable = true; | ||
34 | |||
35 | # This value determines the NixOS release with which your system is | ||
36 | # to be compatible, in order to avoid breaking some software such as | ||
37 | # database servers. You should change this only after NixOS release | ||
38 | # notes say you should. | ||
39 | # https://nixos.org/nixos/manual/release-notes.html | ||
40 | system.stateVersion = "19.03"; # Did you read the comment? | ||
41 | } | ||