mob next [ci-skip] [ci skip] [skip ci]

lastFile:clan.nix
This commit is contained in:
2026-08-11 16:57:03 +07:00
parent 95b78b4d25
commit a0c3960a8c
3 changed files with 62 additions and 44 deletions
+9 -1
View File
@@ -79,11 +79,11 @@ in
in in
{ {
settings = { settings = {
enableOmada = true;
wan = { wan = {
interface = "enp1s0"; interface = "enp1s0";
vlanId = null; vlanId = null;
}; };
vlans = { vlans = {
mgmt = lib.recursiveUpdate (genVlan 10 24) { mgmt = lib.recursiveUpdate (genVlan 10 24) {
dhcp.fixedIPs.storinator01 = { dhcp.fixedIPs.storinator01 = {
@@ -106,6 +106,7 @@ in
}; };
}; };
}; };
trunkPorts = [ "enp2s0" ]; trunkPorts = [ "enp2s0" ];
accessPorts = { accessPorts = {
@@ -113,6 +114,13 @@ in
}; };
upLinkPorts = [ "enp3s0" ]; upLinkPorts = [ "enp3s0" ];
enableOmada = true;
speedtest = {
enable = true;
};
}; };
}; };
}; };
+8 -1
View File
@@ -120,11 +120,18 @@
description = "TP-Link Omada SDN controller (podman container)"; description = "TP-Link Omada SDN controller (podman container)";
}; };
speedtestInterval = lib.mkOption { speedtest = {
enable = {
type = lib.types.bool;
default = false;
description = "Periodic WAN speed test so ISP degradation shows up as a trend. A timer runs librespeed-cli and writes the results as Prometheus metrics into node_exporter's textfile collector";
};
interval = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = "hourly"; default = "hourly";
description = "systemd OnCalendar spec for the WAN speed test."; description = "systemd OnCalendar spec for the WAN speed test.";
}; };
};
proxy = { proxy = {
+4 -1
View File
@@ -3,12 +3,14 @@
nixosModule = nixosModule =
{ {
pkgs, pkgs,
lib,
... ...
}: }:
let let
textfileDir = "/var/lib/speedtest"; textfileDir = "/var/lib/speedtest";
in in
{ {
config = lib.mkIf (settings.speedtest.enable) {
services.prometheus.exporters.node.extraFlags = [ services.prometheus.exporters.node.extraFlags = [
"--collector.textfile.directory=${textfileDir}" "--collector.textfile.directory=${textfileDir}"
]; ];
@@ -46,7 +48,7 @@
systemd.timers.speedtest = { systemd.timers.speedtest = {
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig = { timerConfig = {
OnCalendar = settings.speedtestInterval; OnCalendar = settings.speedtest.interval;
RandomizedDelaySec = "10m"; RandomizedDelaySec = "10m";
Persistent = true; Persistent = true;
}; };
@@ -54,4 +56,5 @@
}; };
}; };
};
} }