Commit 4f6691c9 authored by Benedikt von Blomberg's avatar Benedikt von Blomberg Committed by Bjørn Forsman
Browse files

nixos/ddclient: added assertions for passwordFile and secretsFile

nix fmt
parent 38a03fc4
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -262,6 +262,17 @@ in
      lib.optional (cfg.use != "")
        "Setting `use` is deprecated, ddclient now supports `usev4` and `usev6` for separate IPv4/IPv6 configuration.";

    assertions = [
      {
        assertion = !((cfg.passwordFile != null) && (cfg.secretsFile != null));
        message = "You cannot use both services.ddclient.passwordFile and services.ddclient.secretsFile at the same time.";
      }
      {
        assertion = !(cfg.protocol == "nsupdate") || (cfg.passwordFile == null && cfg.secretsFile == null);
        message = "You cannot use services.ddclient.passwordFile and or services.ddclient.secretsFile when services.ddclient.protocol is \"nsupdate\".";
      }
    ];

    systemd.services.ddclient = {
      description = "Dynamic DNS Client";
      wantedBy = [ "multi-user.target" ];