diff options
Diffstat (limited to 'modules/private/system/monitoring-1.nix')
-rw-r--r-- | modules/private/system/monitoring-1.nix | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/modules/private/system/monitoring-1.nix b/modules/private/system/monitoring-1.nix deleted file mode 100644 index dea5f45..0000000 --- a/modules/private/system/monitoring-1.nix +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | { config, pkgs, resources, ... }: | ||
2 | { | ||
3 | deployment = { | ||
4 | targetUser = "root"; | ||
5 | targetHost = config.hostEnv.ips.main.ip4; | ||
6 | substituteOnDestination = true; | ||
7 | }; | ||
8 | # ssh-keyscan monitoring-1 | nix-shell -p ssh-to-age --run ssh-to-age | ||
9 | secrets.ageKeys = [ "age1dn4lzhgxusqrpjjnzm7w8ml39ptf326htuzmpqdqs2gg3wq7cqzqxuvx8k" ]; | ||
10 | boot.kernelPackages = pkgs.linuxPackages_latest; | ||
11 | myEnv = import ../../../nixops/secrets/environment.nix; | ||
12 | |||
13 | imports = [ <nixpkgs/nixos/modules/profiles/qemu-guest.nix> ] ++ builtins.attrValues (import ../..); | ||
14 | |||
15 | myServices.monitoring.enable = true; | ||
16 | myServices.monitoring.master = true; | ||
17 | myServices.status.enable = true; | ||
18 | networking = { | ||
19 | firewall.enable = true; | ||
20 | interfaces."ens3".ipv4.addresses = pkgs.lib.attrsets.mapAttrsToList | ||
21 | (n: ips: { address = ips.ip4; prefixLength = 32; }) | ||
22 | (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") config.hostEnv.ips); | ||
23 | interfaces."ens3".ipv6.addresses = pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList | ||
24 | (n: ips: map (ip: { address = ip; prefixLength = (if n == "main" && ip == pkgs.lib.head ips.ip6 then 64 else 128); }) (ips.ip6 or [])) | ||
25 | config.hostEnv.ips); | ||
26 | defaultGateway6 = { address = "fe80::1"; interface = "ens3"; }; | ||
27 | }; | ||
28 | boot.loader.grub.device = "nodev"; | ||
29 | fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; }; | ||
30 | myServices.mailRelay.enable = true; | ||
31 | |||
32 | security.pki.certificateFiles = [ | ||
33 | (pkgs.fetchurl { | ||
34 | url = "http://downloads.e.eriomem.net/eriomemca.pem"; | ||
35 | sha256 = "1ixx4c6j3m26j8dp9a3dkvxc80v1nr5aqgmawwgs06bskasqkvvh"; | ||
36 | }) | ||
37 | ]; | ||
38 | |||
39 | services.netdata.enable = true; | ||
40 | services.netdata.config.web."allow dashboard from" = "localhost"; | ||
41 | services.netdata.config.web."allow badges from" = "*"; | ||
42 | services.netdata.config.web."allow streaming from" = "*"; | ||
43 | services.netdata.config.web."allow netdata.conf from" = "fd*"; | ||
44 | services.netdata.config.web."allow management from" = "fd*"; | ||
45 | networking.firewall.allowedTCPPorts = [ 19999 ]; | ||
46 | environment.etc."netdata/stream.conf".source = config.secrets.fullPaths."netdata-stream.conf"; | ||
47 | |||
48 | secrets.keys = { | ||
49 | "netdata-stream.conf" = { | ||
50 | user = config.services.netdata.user; | ||
51 | group = config.services.netdata.group; | ||
52 | permissions = "0400"; | ||
53 | text = builtins.concatStringsSep "\n" (pkgs.lib.mapAttrsToList (_: key: '' | ||
54 | [${key}] | ||
55 | enabled = yes | ||
56 | default history = 3600 | ||
57 | default memory = ram | ||
58 | health enabled by default = auto | ||
59 | '') config.myEnv.monitoring.netdata_keys); | ||
60 | }; | ||
61 | }; | ||
62 | users.users."${config.services.netdata.user}".extraGroups = [ "keys" ]; | ||
63 | # This value determines the NixOS release with which your system is | ||
64 | # to be compatible, in order to avoid breaking some software such as | ||
65 | # database servers. You should change this only after NixOS release | ||
66 | # notes say you should. | ||
67 | # https://nixos.org/nixos/manual/release-notes.html | ||
68 | system.stateVersion = "20.03"; # Did you read the comment? | ||
69 | } | ||