summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hosts/poweredge-pro/configuration.nix1
-rw-r--r--hosts/poweredge-pro/dhcp-hosts.nix1
-rw-r--r--hosts/poweredge-pro/metrics.nix44
3 files changed, 46 insertions, 0 deletions
diff --git a/hosts/poweredge-pro/configuration.nix b/hosts/poweredge-pro/configuration.nix
index 7463cc5..3a45e83 100644
--- a/hosts/poweredge-pro/configuration.nix
+++ b/hosts/poweredge-pro/configuration.nix
@@ -6,6 +6,7 @@
./filebrowser.nix
./fileshares.nix
./key.nix
+ ./metrics.nix
./networking.nix
./nvidia.nix
./ollama.nix
diff --git a/hosts/poweredge-pro/dhcp-hosts.nix b/hosts/poweredge-pro/dhcp-hosts.nix
index 0a622f7..60b29b5 100644
--- a/hosts/poweredge-pro/dhcp-hosts.nix
+++ b/hosts/poweredge-pro/dhcp-hosts.nix
@@ -16,6 +16,7 @@ let
searxng = { macAddress = "02:00:00:00:77:13"; staticIp = "192.168.77.13"; };
embedtube = { macAddress = "02:00:00:00:77:14"; staticIp = "192.168.77.14"; };
ollama = { macAddress = "02:00:00:00:77:15"; staticIp = "192.168.77.15"; };
+ metrics = { macAddress = "02:00:00:00:77:16"; staticIp = "192.168.77.16"; };
WIN-BGBGC27B1PF = { macAddress = "d8:9e:f3:1c:f0:1c"; staticIp = "192.168.77.30"; }; # DACS
DESKTOP-CQ4UIF9 = { macAddress = "08:bf:b8:3f:bd:48"; staticIp = "192.168.77.31"; }; # Kyle
WIN-6FVMAFOID4G = { macAddress = "00:a0:98:58:10:85"; staticIp = "192.168.77.33"; }; # QB
diff --git a/hosts/poweredge-pro/metrics.nix b/hosts/poweredge-pro/metrics.nix
new file mode 100644
index 0000000..76ffea9
--- /dev/null
+++ b/hosts/poweredge-pro/metrics.nix
@@ -0,0 +1,44 @@
+{ config, inputs, ... }: {
+ imports = [ inputs.telemetry.nixosModules.collectors ];
+
+ services.telemetry.collectors = {
+ enable = true;
+ logs.lokiUrl = "http://metrics:3100"; # The container
+ };
+
+ containers.metrics = {
+ autoStart = true;
+ privateNetwork = true;
+ hostBridge = "br-lan0";
+ localMacAddress = "02:00:00:00:77:16";
+ ephemeral = true;
+
+ # The module reads whatever path you point secretKeyFile at.
+ bindMounts = {
+ "/var/lib/prometheus2" = { hostPath = "/nix/persist/metrics/prometheus2"; isReadOnly = false; };
+ "/var/lib/loki" = { hostPath = "/nix/persist/metrics/loki"; isReadOnly = false; };
+ "/var/lib/grafana" = { hostPath = "/nix/persist/metrics/grafana"; isReadOnly = false; };
+ };
+
+ config = { ... }: {
+ imports = [ inputs.telemetry.nixosModules.server ];
+
+ networking.enableIPv6 = false;
+ networking.interfaces.eth0.useDHCP = true;
+ networking.hosts."192.168.77.11" = [ "poweredge-pro" ];
+
+ services.telemetry.server = {
+ enable = true;
+ collectorHosts = [ "poweredge-pro" ];
+ grafana.generateSecretKey = true;
+ proxy.enable = true;
+ };
+
+ # Pin loki uid+gid
+ users.users.loki = { uid = 3100; group = "loki"; isSystemUser = true; };
+ users.groups.loki.gid = 3100;
+
+ system.stateVersion = "26.05";
+ };
+ };
+}