infra/nix/os/modules/ddclient-ovh.nix
2022-10-31 11:05:05 +01:00

28 lines
668 B
Nix

{ lib, config, ... }:
let
cfg = config.services.ddclientovh;
passwords = import ../../variables/passwords.crypt.nix;
in {
options.services.ddclientovh = with lib; {
enable = mkEnableOption "Enable ddclient-ovh";
domain = mkOption { type = types.str; };
};
config = lib.mkIf cfg.enable {
services.ddclient = {
enable = true;
protocol = "dyndns2";
server = "www.ovh.com";
ssl = true;
domains = [ cfg.domain ];
use = "web";
inherit (passwords.dyndns.${cfg.domain}) username;
passwordFile = builtins.toFile passwords.dyndns._filename
passwords.dyndns.${cfg.domain}.password;
};
};
}