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

32 lines
666 B
Nix
Raw Normal View History

{ 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 ];
2021-08-20 23:27:49 +02:00
use = "web";
2021-12-06 20:22:47 +01:00
inherit (passwords.dyndns.${cfg.domain}) username;
passwordFile = builtins.toFile "" passwords.dyndns.${cfg.domain}.password;
};
};
}