diff --git a/hosts/chunk/Caddyfile b/hosts/chunk/Caddyfile index df9e3ee..3cc44f8 100644 --- a/hosts/chunk/Caddyfile +++ b/hosts/chunk/Caddyfile @@ -60,3 +60,7 @@ pad.cything.io { red.cything.io { reverse_proxy localhost:8087 } + +grafana.cything.io { + reverse_proxy localhost:8088 +} diff --git a/hosts/chunk/default.nix b/hosts/chunk/default.nix index 93c17bd..786d06b 100644 --- a/hosts/chunk/default.nix +++ b/hosts/chunk/default.nix @@ -20,6 +20,7 @@ ./redlib.nix ./vaultwarden.nix ./wireguard.nix + ./grafana.nix ]; sops.defaultSopsFile = ./secrets.yaml; @@ -79,11 +80,21 @@ prefixLength = 64; } ]; + ipv4.addresses = [ + { + address = "31.59.129.225"; + prefixLength = 24; + } + ]; }; networking.defaultGateway6 = { address = "2a0f:85c1:840::1"; interface = "ens18"; }; + networking.defaultGateway = { + address = "31.59.129.1"; + interface = "ens18"; + }; networking.nameservers = ["127.0.0.1" "::1"]; time.timeZone = "America/Toronto"; diff --git a/hosts/chunk/grafana.nix b/hosts/chunk/grafana.nix new file mode 100644 index 0000000..5bfdb07 --- /dev/null +++ b/hosts/chunk/grafana.nix @@ -0,0 +1,31 @@ +{config,...}: { + services.grafana = { + enable = true; + settings.server = { + http_addr = "127.0.0.1"; + http_port = 8088; + enforce_domain = true; + enable_gzip = true; + domain = "grafana.cything.io"; + }; + settings.analytics.reporting_enabled = false; + }; + + services.prometheus = { + enable = true; + exporters = { + node = { + enable = true; + enabledCollectors = [ "systemd" ]; + }; + }; + scrapeConfigs = [ + { + job_name = "chrysalis"; + static_configs = [{ + targets = ["127.0.0.1:${toString config.services.prometheus.exporters.node.port}"]; + }]; + } + ]; + }; +}