Skip to content

mccartykim/cloudflare-ddns-flake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cloudflare-ddns-flake

Generic NixOS module that wraps services.inadyn to keep a Cloudflare zone's A records pointed at the host's current public IP. One API token updates the zone root plus any extra hostnames.

Does not manage secrets — pass a runtime path to a Zone:DNS:Edit token (agenix, sops, etc.).

Options (services.cloudflareDdns)

option type default note
enable bool false
domain str Cloudflare zone name; also the inadyn username
extraHostnames [str] [] extra records; *.example.com covers all subs
apiTokenFile path runtime path to a Zone:DNS:Edit token
ttl int 1 1 = automatic on Cloudflare
proxied bool false orange-cloud
updatePeriod int 300 inadyn check interval, seconds

Usage

inputs.cloudflare-ddns.url = "github:mccartykim/cloudflare-ddns-flake";

# in a host config:
imports = [ inputs.cloudflare-ddns.nixosModules.default ];
services.cloudflareDdns = {
  enable = true;
  domain = "example.com";
  extraHostnames = [ "*.example.com" ];
  apiTokenFile = config.age.secrets.cloudflare-token.path;
};

Contents

flake.nix, module.nix. That's it.

About

Cloudflare dynamic DNS via inadyn — generic NixOS module

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages