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
{
settings = {
enableOmada = true;
wan = {
interface = "enp1s0";
vlanId = null;
};
vlans = {
mgmt = lib.recursiveUpdate (genVlan 10 24) {
dhcp.fixedIPs.storinator01 = {
@@ -106,6 +106,7 @@ in
};
};
};
trunkPorts = [ "enp2s0" ];
accessPorts = {
@@ -113,6 +114,13 @@ in
};
upLinkPorts = [ "enp3s0" ];
enableOmada = true;
speedtest = {
enable = true;
};
};
};
};
+8 -1
View File
@@ -120,11 +120,18 @@
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;
default = "hourly";
description = "systemd OnCalendar spec for the WAN speed test.";
};
};
proxy = {
+4 -1
View File
@@ -3,12 +3,14 @@
nixosModule =
{
pkgs,
lib,
...
}:
let
textfileDir = "/var/lib/speedtest";
in
{
config = lib.mkIf (settings.speedtest.enable) {
services.prometheus.exporters.node.extraFlags = [
"--collector.textfile.directory=${textfileDir}"
];
@@ -46,7 +48,7 @@
systemd.timers.speedtest = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = settings.speedtestInterval;
OnCalendar = settings.speedtest.interval;
RandomizedDelaySec = "10m";
Persistent = true;
};
@@ -54,4 +56,5 @@
};
};
};
}