nixos/modules/services/dyndns/default.nix

37 lines
846 B
Nix
Raw Normal View History

2023-06-04 17:17:35 +02:00
# running dyndns updates
2023-11-07 22:00:00 +01:00
{ config, lib, ... }:
2023-06-04 17:17:35 +02:00
let
cfg = config.my.services.dyndns;
2023-11-07 23:13:51 +01:00
inherit (config.networking) domain;
2023-06-04 17:17:35 +02:00
in
{
2025-09-21 18:40:36 +02:00
options.my.services.dyndns = {
enable = lib.mkEnableOption "Dyndns";
2023-06-04 17:17:35 +02:00
2025-09-21 18:40:36 +02:00
username = lib.mkOption {
type = lib.types.str;
2023-06-04 17:17:35 +02:00
description = "Username for the dyndns.";
example = "admin";
default = "Stunkymonkey-dyndns";
};
2025-09-21 18:40:36 +02:00
passwordFile = lib.mkOption {
type = lib.types.path;
2023-06-04 17:17:35 +02:00
description = "Password for the username for dyndns.";
example = "/run/secrets/freshrss";
};
};
config = lib.mkIf cfg.enable {
services.inadyn = {
2023-06-04 17:17:35 +02:00
enable = true;
settings.provider = {
"default@inwx.com" = {
inherit (cfg) username;
include = cfg.passwordFile;
hostname = "serverle.${domain}";
};
};
2023-06-04 17:17:35 +02:00
};
};
}