DDclient options

I want to use opendns for my son computer,
I need to configure the ddclient,conf normally in /etc/ddclients.conf
I noticed the huge amount of options for the package which got me a bit scared, but maybe one of you can come to the recue?
The config needs to look something like this:

##
## OpenDNS.com account-configuration
##
protocol=dyndns2
use=web, web=myip.dnsomatic.com
ssl=yes
server=updates.opendns.com
login=opendns_username
password='opendns_password'
opendns_network_label

Something like this

environment.systemPackages = with pkgs; [ ddclient ];

services.ddclient.enable = true;
services.ddclient.quiet = true;
services.ddclient.protocol = "dyndns2";
services.ddclient.use = "web, web=myip.dnsomatic.com";
services.ddclient.ssl = "yes";
services.ddclient.server = "updates.opendns.com";
services.ddclient.username = "opendns_username";
services.ddclient.passwordFile= "opendns_password";
services.ddclient.extraConfig = "opendns_network_label";

or

services.ddclient.configFile = "/root/nixos/secrets/ddclient.conf";

I think my syntax is not okay?

Hi Henry,

first of all, take a look at man configuration.nix and search for services.ddclient to see the options. I’d be surprised if all the knobs you need to adjust aren’t already exposed.

Alternatively, the module also exposes a `configFile’ attribute that acts as an override, so you could do something like this:

{
  services.ddclient = {
    enable = true;
    configFile = pkgs.writeText "my-config-file" ''
      protocol=dyndns2
      use=web, web=myip.dnsomatic.com
      ssl=yes
      server=updates.opendns.com
      login=opendns_username
      password='opendns_password'
      opendns_network_label
    '';
  };
}

Please note that this means the password is stored directly in the nix store and thus visible to everyone but it might be OK for testing purposes. You could also specify a non-store path of course:

{
  services.ddclient = {
    enable = true;
    configFile = "/private/ddclient_opendns.conf";
  };
}

And then manually create that file with the required contents.

man configuration.nix is great. I did not know that a file could have a man page, never to old to learn,