2022-10-31 11:04:38 +01:00
|
|
|
{ lib, config, ... }:
|
2019-02-03 11:55:23 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.ddclientovh;
|
|
|
|
|
|
|
|
passwords = import ../../variables/passwords.crypt.nix;
|
|
|
|
|
|
|
|
in {
|
|
|
|
|
|
|
|
options.services.ddclientovh = with lib; {
|
|
|
|
enable = mkEnableOption "Enable ddclient-ovh";
|
2022-10-31 11:04:38 +01:00
|
|
|
domain = mkOption { type = types.str; };
|
2019-02-03 11:55:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
domains = [ cfg.domain ];
|
|
|
|
use = "web";
|
|
|
|
inherit (passwords.dyndns.${cfg.domain}) username;
|
|
|
|
passwordFile = builtins.toFile passwords.dyndns._filename
|
|
|
|
passwords.dyndns.${cfg.domain}.password;
|
2019-02-03 11:55:23 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|