[solved] Letsencrypt wildcard domain

I’m trying to set up a wildcard domain for nginx + ssl. Using it directly as the virtualHost doesn’t work, I got the message to use the domain attribute. This evaluates, but then ACME fails:

services.nginx.virtualHosts.${"sub.doma.in"} = {
  # ... other config
  enableACME = true;
}
security.acme.certs.${"sub.doma.in"}.domain = "*.sub.doma.in";

Alas, this fails:

acme-sub.doma.in-start[28666]: 2021/05/05 08:16:08 [INFO] [*.sub.doma.in] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/12867309504
acme-sub.doma.in-start[28666]: 2021/05/05 08:16:08 [INFO] [*.sub.doma.in] acme: Could not find solver for: dns-01
acme-sub.doma.in-start[28666]: 2021/05/05 08:16:08 [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz-v3/12867309504
acme-sub.doma.in-start[28666]: 2021/05/05 08:16:09 Could not obtain certificates:
acme-sub.doma.in-start[28666]:         error: one or more domains had a problem:
acme-sub.doma.in-start[28666]: [*.sub.doma.in] [*.sub.doma.in] acme: could not determine solvers

Any ideas?

:man_facepalming: This is documented SSL/TLS Certificates with ACME

Nevermind :sweat_smile:

Link to formatted form NixOS 23.11 manual | Nix & NixOS

1 Like