]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - private/system/monitoring-1.nix
Add tools
[perso/Immae/Config/Nix.git] / private / system / monitoring-1.nix
1 { privateFiles }:
2 { config, pkgs, resources, ... }:
3 {
4 boot.kernelPackages = pkgs.linuxPackages_latest;
5 myEnv = import "${privateFiles}/environment.nix" // { inherit privateFiles; };
6
7 imports = builtins.attrValues (import ../..);
8
9 deployment = {
10 targetEnv = "hetznerCloud";
11 hetznerCloud = {
12 authToken = config.myEnv.hetznerCloud.authToken;
13 datacenter = "hel1-dc2";
14 location ="hel1";
15 serverType = "cx11";
16 };
17 };
18
19 myServices.monitoring.enable = true;
20 myServices.monitoring.master = true;
21 myServices.status.enable = true;
22 networking = {
23 firewall.enable = true;
24 interfaces."ens3".ipv4.addresses = pkgs.lib.attrsets.mapAttrsToList
25 (n: ips: { address = ips.ip4; prefixLength = 32; })
26 (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") config.hostEnv.ips);
27 interfaces."ens3".ipv6.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList
28 (n: ips: map (ip: { address = ip; prefixLength = (if n == "main" && ip == pkgs.lib.head ips.ip6 then 64 else 128); }) (ips.ip6 or []))
29 config.hostEnv.ips);
30 defaultGateway6 = { address = "fe80::1"; interface = "ens3"; };
31 };
32 myServices.mailRelay.enable = true;
33
34 # This value determines the NixOS release with which your system is
35 # to be compatible, in order to avoid breaking some software such as
36 # database servers. You should change this only after NixOS release
37 # notes say you should.
38 # https://nixos.org/nixos/manual/release-notes.html
39 system.stateVersion = "20.03"; # Did you read the comment?
40 }