apu: setup dynamic dns record based on DHCP leases
Some checks failed
Build Images / build (push) Failing after 1m21s
Check / check (push) Successful in 3m36s

This commit is contained in:
Joakim Repomaa
2026-02-21 13:05:22 +02:00
parent 6690b5c1ea
commit 13e119a6c3
5 changed files with 324 additions and 1 deletions

View File

@@ -26,6 +26,11 @@ let
default = { };
};
ipv6 = lib.mkEnableOption "ipv6";
domain = lib.mkOption {
type = lib.types.str;
default = "home.arpa";
description = "Domain name to advertise via DHCP";
};
};
};
@@ -96,6 +101,7 @@ let
id,
ipv6,
staticLeases,
domain,
...
}:
{
@@ -115,8 +121,17 @@ let
dhcpServerConfig = {
PoolOffset = 255;
DNS = "10.${toString id}.0.1";
EmitDNS = true;
};
extraConfig = lib.concatLines (lib.mapAttrsToList buildStaticLease staticLeases);
extraConfig = lib.concatLines (
(lib.mapAttrsToList buildStaticLease staticLeases)
++ [
''
[DHCPServer]
SendOption=15:string:${domain}
''
]
);
};
};