2 { config, lib, name, ... }:
4 inherit (lib) literalExpression mkOption types;
12 description = lib.mdDoc "Canonical hostname for the server.";
15 serverAliases = mkOption {
16 type = with types; listOf str;
18 example = [ "www.example.org" "example.org" ];
19 description = lib.mdDoc ''
20 Additional names of virtual hosts served by this virtual host configuration.
24 listenAddresses = mkOption {
25 type = with types; listOf str;
26 description = lib.mdDoc ''
27 A list of host interfaces to bind to for this virtual host.
30 example = [ "127.0.0.1" "::1" ];
33 useACMEHost = mkOption {
34 type = types.nullOr types.str;
36 description = lib.mdDoc ''
37 A host of an existing Let's Encrypt certificate to use.
38 This is mostly useful if you use DNS challenges but Caddy does not
39 currently support your provider.
41 *Note that this option does not create any certificates, nor
42 does it add subdomains to existing ones – you will need to create them
43 manually using [](#opt-security.acme.certs).*
47 logFormat = mkOption {
50 output file ${cfg.logDir}/access-${config.hostName}.log
53 output file ''${config.services.caddy.logDir}/access-''${hostName}.log
55 example = literalExpression ''
60 description = lib.mdDoc ''
61 Configuration for HTTP request logging (also known as access logs). See
62 <https://caddyserver.com/docs/caddyfile/directives/log#log>
67 extraConfig = mkOption {
70 description = lib.mdDoc ''
71 Additional lines of configuration appended to this virtual host in the
72 automatically generated `Caddyfile`.