feat(nixosModules/server): add godns dynamic dns

This commit is contained in:
Mohammad Rafiq 2025-05-29 15:10:57 +08:00
parent aa777bfa54
commit c0d02eea1d
No known key found for this signature in database
3 changed files with 45 additions and 4 deletions

View file

@ -0,0 +1,38 @@
{ lib, config, ... }:
{
options.server = {
enableDDNS = lib.mkEnableOption "";
};
config = lib.mkMerge [
(lib.mkIf config.server.enableDDNS {
services.godns = {
enable = true;
loadCredential = [
"cf_token:${config.sops.secrets."keys/cloudflare".path}"
];
settings = {
provider = "Cloudflare";
login_token_file = "$CREDENTIALS_DIRECTORY/cf_token";
domains = [
{
domain_name = "rrv.sh";
sub_domains = [
"@"
];
}
];
resolver = "1.1.1.1";
ip_urls = [
"https://wtfismyip.com/text"
"https://api.ipify.org"
"https://myip.biturl.top"
"https://api-ipv4.ip.sb/ip"
];
ip_type = "IPv4";
interval = 300;
};
};
})
];
}