infra/nix/os/modules/ddclient-ovh.nix

30 lines
675 B
Nix
Raw Normal View History

2023-02-07 18:24:28 +01:00
{
lib,
config,
...
}: let
cfg = config.services.ddclientovh;
passwords = import ../../variables/passwords.crypt.nix;
in {
options.services.ddclientovh = with lib; {
enable = mkEnableOption "Enable ddclient-ovh";
2023-02-07 18:24:28 +01:00
domain = mkOption {type = types.str;};
};
config = lib.mkIf cfg.enable {
2022-10-31 11:04:38 +01:00
services.ddclient = {
enable = true;
protocol = "dyndns2";
server = "www.ovh.com";
ssl = true;
2023-02-07 18:24:28 +01:00
domains = [cfg.domain];
2022-10-31 11:04:38 +01:00
use = "web";
inherit (passwords.dyndns.${cfg.domain}) username;
2023-02-07 18:24:28 +01:00
passwordFile =
builtins.toFile passwords.dyndns._filename
2022-10-31 11:04:38 +01:00
passwords.dyndns.${cfg.domain}.password;
};
};
}