Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
47 lines
1.2 KiB
Nix
47 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.services.ddns-updater;
|
|
in
|
|
{
|
|
options.services.ddns-updater = {
|
|
enable = lib.mkEnableOption "Container to update DNS records periodically with WebUI for many DNS providers";
|
|
|
|
package = lib.mkPackageOption pkgs "ddns-updater" { };
|
|
|
|
environment = lib.mkOption {
|
|
type = lib.types.attrsOf lib.types.str;
|
|
description = "Environment variables to be set for the ddns-updater service. DATADIR is ignored to enable using systemd DynamicUser. For full list see <https://github.com/qdm12/ddns-updater>";
|
|
default = { };
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
systemd.services.ddns-updater = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
wants = [ "network-online.target" ];
|
|
after = [ "network-online.target" ];
|
|
environment = cfg.environment // {
|
|
DATADIR = "%S/ddns-updater";
|
|
};
|
|
unitConfig = {
|
|
Description = "DDNS-updater service";
|
|
};
|
|
serviceConfig = {
|
|
TimeoutSec = "5min";
|
|
ExecStart = lib.getExe cfg.package;
|
|
RestartSec = 30;
|
|
DynamicUser = true;
|
|
StateDirectory = "ddns-updater";
|
|
Restart = "on-failure";
|
|
};
|
|
};
|
|
};
|
|
}
|