From 465bde1b98888981e1743177a618e81112a9c1bb Mon Sep 17 00:00:00 2001 From: Ahwx Date: Tue, 16 Jun 2026 19:01:34 +0200 Subject: [PATCH 1/3] feat: adds `zpool-iostat-viz` --- hosts/flora/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/flora/default.nix b/hosts/flora/default.nix index 6a2eedf..2a9a77c 100644 --- a/hosts/flora/default.nix +++ b/hosts/flora/default.nix @@ -78,6 +78,7 @@ environment.systemPackages = [ pkgs.kitty pkgs.foot + pkgs.zpool-iostat-viz ]; time.timeZone = "Europe/Amsterdam"; From fd1e79eb5616683a36d7d7ef55cc27cf86d5fd8a Mon Sep 17 00:00:00 2001 From: Ahwx Date: Tue, 16 Jun 2026 19:01:50 +0200 Subject: [PATCH 2/3] fix: also add user to `qemu-libvirtd` --- modules/core/virtualization.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/core/virtualization.nix b/modules/core/virtualization.nix index 8a54dbe..a70610d 100644 --- a/modules/core/virtualization.nix +++ b/modules/core/virtualization.nix @@ -46,6 +46,9 @@ users.groups.libvirtd.members = if (config.virtualisation.libvirtd.enable == true) then [ username ] else [ ]; + users.groups.qemu-libvirtd.members = + if (config.virtualisation.libvirtd.enable == true) then [ username ] else [ ]; + # Enable qemu etc environment.systemPackages = with pkgs; [ qemu From cd822b8f21420096bada2a6744208a66d5d3f956 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Tue, 16 Jun 2026 19:02:09 +0200 Subject: [PATCH 3/3] feat: improve monitoring by adding more modules for prometheus; adds loki --- modules/services/monitoring.nix | 90 ++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 6 deletions(-) diff --git a/modules/services/monitoring.nix b/modules/services/monitoring.nix index b24e67b..0c8b7d6 100644 --- a/modules/services/monitoring.nix +++ b/modules/services/monitoring.nix @@ -5,9 +5,30 @@ enable = true; port = 9001; exporters = { + smartctl.enable = true; + zfs.enable = true; node = { enable = true; - enabledCollectors = [ "systemd" ]; + enabledCollectors = [ + "systemd" + "cpu" + "cpufreq" + "diskstats" + "filesystem" + "loadavg" + "meminfo" + "netdev" + "stat" + "time" + "uname" + "hwmon" + "bcache" + "conntrack" + "dmi" + "nvme" + "thermal_zone" + "zfs" + ]; port = 9002; }; smokeping = { @@ -37,12 +58,69 @@ } ]; } + { + job_name = "${host} - smartctl"; + static_configs = [ + { + targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.smartctl.port}" ]; + } + ]; + } + { + job_name = "${host} - zfs"; + static_configs = [ + { + targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.zfs.port}" ]; + } + ]; + } ]; }; + loki = { + enable = true; + configuration = { + auth_enabled = false; + server.http_listen_port = 9003; + + common = { + path_prefix = "/var/lib/loki"; + replication_factor = 1; + ring.kvstore.store = "inmemory"; + }; + + schema_config.configs = [ + { + from = "2024-01-01"; + store = "tsdb"; + object_store = "filesystem"; + schema = "v13"; + index = { + prefix = "index_"; + period = "24h"; + }; + } + ]; + + storage_config.filesystem.directory = "/var/lib/loki/chunks"; + + limits_config = { + retention_period = "90d"; + reject_old_samples = true; + reject_old_samples_max_age = "8h"; + }; + + compactor = { + working_directory = "/var/lib/loki/compactor"; + delete_request_store = "filesystem"; + retention_enabled = true; + }; + }; + }; + }; + networking.firewall = { + allowedTCPPorts = [ + 9001 + 9003 + ]; }; - # networking.firewall = { - # allowedTCPPorts = [ - # 9001 - # ]; - # }; }