[BROKEN DYNDNS] feat(containers): switch to hetzner for primary domain
This commit is contained in:
parent
09374a71fd
commit
9988e3e969
7 changed files with 132 additions and 35 deletions
39
nix/os/modules/ddclient-hetzner.nix
Normal file
39
nix/os/modules/ddclient-hetzner.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.services.ddclient-hetzner;
|
||||
in {
|
||||
options.services.ddclient-hetzner = with lib; {
|
||||
enable = mkEnableOption "Enable ddclient-hetzner";
|
||||
zone = mkOption {type = types.str;};
|
||||
domains = mkOption {type = types.listOf types.str;};
|
||||
passwordFile = mkOption {type = types.path;};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.groups.ddclient = {};
|
||||
users.users.ddclient = {
|
||||
isSystemUser = true;
|
||||
group = "ddclient";
|
||||
};
|
||||
|
||||
services.ddclient = {
|
||||
enable = cfg.enable;
|
||||
verbose = true;
|
||||
protocol = "hetzner";
|
||||
|
||||
# see https://github.com/ddclient/ddclient/blob/a4eab34ab4719d1e2146d8c9c4449b70dd7e0163/ddclient.in#L775
|
||||
username = "token";
|
||||
|
||||
inherit (cfg) zone domains passwordFile;
|
||||
|
||||
extraConfig = ''
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.services.ddclient.serviceConfig.User = config.users.users.ddclient.name;
|
||||
systemd.services.ddclient.serviceConfig.Group = config.users.groups.ddclient.name;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue