anchor.diff:  let
     cfg = config.services.caddy;
     configFile = pkgs.writeText "Caddyfile" cfg.config;
  +
  +  # v2-specific options
  +  isCaddy2 = versionAtLeast cfg.package.version "2.0";
  +  tlsConfig = {
  +    apps.tls.automation.policies = [{
  +      issuer = {
  +        inherit (cfg) ca email;
  +        module = "acme";
  +      };
  +    }];
  +  };
  +  adaptedConfig = importJSON (pkgs.runCommand "caddy-config-adapted.json" { } ''
  +    ${cfg.package}/bin/caddy adapt \
  +      --config ${configFile} --adapter ${cfg.adapter} > $out
  +  '');
  +  configJSON = pkgs.writeText "caddy-config.json" (builtins.toJSON
  +    (recursiveUpdate adaptedConfig tlsConfig));
   in {
     options.services.caddy = {
       enable = mkEnableOption "Caddy web server";
   
       config = mkOption {
         default = "";
  +      # TODO: update example text on v2.0 release
         example = ''
           example.com {
           gzip
  
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 {
  