This repository has been archived on 2024-07-08. You can view files and clone it, but cannot push or open issues or pull requests.
nix-config-tn/nixos/hosts/common/optional/cloudflare-dyndns.nix

29 lines
912 B
Nix
Raw Normal View History

2024-03-18 04:26:02 -05:00
{ config
, lib
, ...
2024-03-17 16:04:32 -05:00
}: {
2024-03-16 21:31:36 -05:00
# Current nixpkgs cf-ddns only supports using a env file for the apitoken
# but not for domains, which makes them hard to find.
# To circumvent this, I put both in the 'apiTokenFile' var
# so my secret is:
# apiTokenFile: |-
# CLOUDFLARE_API_TOKEN=derp
# CLOUDFLARE_DOMAINS=derp.herp.xyz derp1.herp.xyz
# init secret
config.sops.secrets."system/networking/cloudflare-dyndns/apiTokenFile".sopsFile = ./cloudflare-dyndns.sops.yaml;
# Restart when secret changes
2024-03-18 04:26:02 -05:00
config.sops.secrets."system/networking/cloudflare-dyndns/apiTokenFile".restartUnits = [ "cloudflare-dyndns" ];
2024-03-16 21:31:36 -05:00
# Cloudflare dynamic dns to keep my DNS records pointed at home
config.services.cloudflare-dyndns = {
enable = true;
ipv6 = false;
proxied = true;
apiTokenFile = config.sops.secrets."system/networking/cloudflare-dyndns/apiTokenFile".path;
2024-03-18 04:26:02 -05:00
domains = [ ];
2024-03-16 21:31:36 -05:00
};
}