anchor.diff:        after = [ "network-online.target" ];
         wants = [ "network-online.target" ]; # systemd-networkd-wait-online.service
         wantedBy = [ "multi-user.target" ];
  -      environment = mkIf (versionAtLeast config.system.stateVersion "17.09")
  +      environment = mkIf (versionAtLeast config.system.stateVersion "17.09" && !isCaddy2)
           { CADDYPATH = cfg.dataDir; };
         serviceConfig = {
  -        ExecStart = ''
  +        ExecStart = if isCaddy2 then ''
  +          ${cfg.package}/bin/caddy run --config ${configJSON}
  +        '' else ''
             ${cfg.package}/bin/caddy -log stdout -log-timestamps=false \
               -root=/var/tmp -conf=${configFile} \
               -ca=${cfg.ca} -email=${cfg.email} ${optionalString cfg.agree "-agree"}
  
positive.code:     package = mkOption {
        default = pkgs.caddy;
        defaultText = "pkgs.caddy";
        type = types.package;
        description = "Caddy package to use.";
      };
    };
  
  
negative.code:       '';
        type = types.lines;
        description = "Verbatim Caddyfile to use";
      };
  
      adapter = mkOption {
        default = "caddyfile";
        example = "nginx";
        type = types.str;
        description = ''
          Name of the config adapter to use.
  
          See https://caddyserver.com/docs/config-adapters for the full list.
        '';
      };
  
      ca = mkOption {
  