nixos/modules/services/dyndns/default.nix
2023-11-07 23:19:48 +01:00

33 lines
782 B
Nix

# running dyndns updates
{ config, lib, ... }:
let
cfg = config.my.services.dyndns;
inherit (config.networking) domain;
in
{
options.my.services.dyndns = with lib; {
enable = mkEnableOption "Dyndns";
username = mkOption {
type = types.str;
description = "Username for the dyndns.";
example = "admin";
default = "Stunkymonkey-dyndns";
};
passwordFile = mkOption {
type = types.path;
description = "Password for the username for dyndns.";
example = "/run/secrets/freshrss";
};
};
config = lib.mkIf cfg.enable {
services.ddclient = {
enable = true;
server = "dyndns.inwx.com";
inherit (cfg) username passwordFile;
domains = [ "serverle.${domain}" ];
ipv6 = true;
};
};
}