Skip to content

ddclient NixOS module generates incorrect service unit, referencing old system generations #472547

@JuggerbAUT

Description

@JuggerbAUT

Nixpkgs version

  • Stable (25.11)

Describe the bug

The ddclient NixOS module appears to be generating a ddclient.service unit file that contains a hardcoded path to a pre-start script from a previous NixOS generation. This causes the service to use an old and incorrect configuration,
even after a nixos-rebuild switch. Manually restarting the service or running systemctl daemon-reload does not fix the issue.

This was discovered while troubleshooting why ddclient was failing to determine the public IP address after a configuration change. The service logs continued to show errors related to the old configuration, despite the
configuration.nix file being correct and the system having been rebuilt.

Steps to reproduce

  1. Configure services.ddclient in configuration.nix with a deprecated option like use = "web";.
  2. Run sudo nixos-rebuild switch.
  3. Observe ddclient failing as expected.
  4. Correct the configuration to use a modern option, for example: usev4 = "webv4";.
  5. Run sudo nixos-rebuild switch again.
  6. Observe that the ddclient.service status and logs still show the same failure, indicating it is using the old, cached configuration. systemctl cat ddclient.service will show an ExecStartPre path from the previous system
    generation.

Expected behaviour

After a nixos-rebuild switch, the ddclient.service unit should be updated to use the scripts and configuration from the new system generation.

Screenshots

No response

Relevant log output

Additional context

  • Here is the relevant (and correct) section from my configuration.nix:
    1   services.ddclient = {
    2     enable = true;
    3     interval = "10min";
    4     protocol = "cloudflare";
    5     zone = "example.cc";
    6     username = "token"; 
    7     passwordFile = "/etc/nixos/secrets/cloudflare";
    8     domains = [ "app.example.cc" "mail.example.cc" ];
    9     ssl = true;
   10     usev4 = "web, web=https://api.ipify.org";
   11     extraConfig = ''
   12       usev6=disabled
   13     '';
   14   };
  • Actual behavior

The ddclient.service unit continues to reference a pre-start script from a previous generation, causing it to use an outdated and incorrect configuration.

  • Workaround

The service can be made to work by manually creating a ddclient.conf file with the correct syntax and running the ddclient executable directly. This, however, does not survive an IP change or a reboot.

System metadata

  • system: "x86_64-linux"
  • host os: Linux 6.12.61, NixOS, 25.11 (Xantusia), 25.11.1335.09eb77e94fa2
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.31.2
  • channels(root): "nixos-25.11, nixos-unstable"
  • nixpkgs: /nix/store/j4hbw1ws742nmsfhbd9r22k1qgivk7hc-nixos-25.11/nixos

Notify maintainers


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      SYSTEM_READY >> ...MS