Hello,
I recently upgraded from NixOS 24.11 to 25.11 (system.stateVersion = “25.11”) and am now unable to get a Let’s Encrypt certificate via the Cloudflare DNS provider. The security.acme service persistently defaults to using minica to
generate a self-signed certificate, ignoring the dnsProvider configuration.
This leads to “Invalid SSL certificate” errors when Cloudflare’s SSL/TLS mode is set to “Full (Strict)”.
Relevant configuration.nix:
1 { config, pkgs, ... }: {
2 system.stateVersion = "25.11";
3
4 # Nginx
5 services.nginx.virtualHosts."example.cc" = {
6 forceSSL = true;
7 useACMEHost = "example.cc";
8 # ...
9 };
10
11 # ACME
12 security.acme = {
13 acceptTerms = true;
14 defaults.email = “example@gmail.com”;
15
16 certs.“example.cc” = {
17 domain = “example.cc”;
18 dnsProvider = “cloudflare”;
19 credentialsFile = “/etc/nixos/secrets/cloudflare-acme”;
20 group = “nginx”;
21 };
22 };
23 }
journalctl -u acme-example.cc.service logs:
The logs consistently show minica being executed, never lego:
1 Starting Ensure certificate for example.cc…
2 + minica --ca-key ca/key.pem --ca-cert ca/cert.pem --domains example.cc
3 …4 Finished Ensure certificate for example.cc.
What has been tried:
- Confirmed credentialsFile path is correct.
- Confirmed the secret file at /etc/nixos/secrets/cloudflare-acme has the correct format (CLOUDFLARE_DNS_API_TOKEN=“…”).
- Confirmed the secret file has secure permissions (640, owned by root:users).
- The Cloudflare API Token has Zone:DNS:Edit permissions for the correct zone.
- This exact setup was working on NixOS 24.11.
It seems the security.acme module on 25.11 is not respecting the dnsProvider attribute. Is this a known bug, or is there a new, required option to force the lego backend?
Thank you