anchor.diff:  
   let
     cfg = config.services.traefik;
  -  configFile =
  -    if cfg.configFile == null then
  -      pkgs.runCommand "config.toml" {
  -        buildInputs = [ pkgs.remarshal ];
  -        preferLocalBuild = true;
  -      } ''
  -        remarshal -if json -of toml \
  -          < ${pkgs.writeText "config.json" (builtins.toJSON cfg.configOptions)} \
  -          > $out
  -      ''
  -    else cfg.configFile;
  -
  +  dynamicConfigFile = if cfg.dynamicConfigFile == null then
  +    pkgs.runCommand "config.toml" {
  +      buildInputs = [ pkgs.remarshal ];
  +      preferLocalBuild = true;
  +    } ''
  +      remarshal -if json -of toml \
  +        < ${
  +          pkgs.writeText "dynamic_config.json"
  +          (builtins.toJSON cfg.dynamicConfigOptions)
  +        } \
  +        > $out
  +    ''
  +  else
  +    cfg.dynamicConfigFile;
  +  staticConfigFile = if cfg.staticConfigFile == null then
  +    pkgs.runCommand "config.toml" {
  +      buildInputs = [ pkgs.yj ];
  +      preferLocalBuild = true;
  +    } ''
  +      yj -jt -i \
  +        < ${
  +          pkgs.writeText "static_config.json" (builtins.toJSON
  +            (recursiveUpdate cfg.staticConfigOptions {
  +              providers.file.filename = "${dynamicConfigFile}";
  +            }))
  +        } \
  +        > $out
  +    ''
  +  else
  +    cfg.staticConfigFile;
   in {
     options.services.traefik = {
       enable = mkEnableOption "Traefik web server";
   
  -    configFile = mkOption {
  +    staticConfigFile = mkOption {
         default = null;
  -      example = literalExample "/path/to/config.toml";
  +      example = literalExample "/path/to/static_config.toml";
         type = types.nullOr types.path;
         description = ''
  -        Path to verbatim traefik.toml to use.
  -        (Using that option has precedence over <literal>configOptions</literal>)
  +        Path to traefik's static configuration to use.
  +        (Using that option has precedence over <literal>staticConfigOptions</literal> and <literal>dynamicConfigOptions</literal>)
         '';
       };
   
  -    configOptions = mkOption {
  +    staticConfigOptions = mkOption {
         description = ''
  -        Config for Traefik.
  +        Static configuration for Traefik.
         '';
         type = types.attrs;
  -      default = {
  -        defaultEntryPoints = ["http"];
  -        entryPoints.http.address = ":80";
  -      };
  +      default = { entryPoints.http.address = ":80"; };
         example = {
  -        defaultEntrypoints = [ "http" ];
  -        web.address = ":8080";
  +        entryPoints.web.address = ":8080";
           entryPoints.http.address = ":80";
   
  -        file = {};
  -        frontends = {
  -          frontend1 = {
  -            backend = "backend1";
  -            routes.test_1.rule = "Host:localhost";
  -          };
  +        api = { };
  +      };
  +    };
  +
  +    dynamicConfigFile = mkOption {
  +      default = null;
  +      example = literalExample "/path/to/dynamic_config.toml";
  +      type = types.nullOr types.path;
  +      description = ''
  +        Path to traefik's dynamic configuration to use.
  +        (Using that option has precedence over <literal>dynamicConfigOptions</literal>)
  +      '';
  +    };
  +
  +    dynamicConfigOptions = mkOption {
  +      description = ''
  +        Dynamic configuration for Traefik.
  +      '';
  +      type = types.attrs;
  +      default = { };
  +      example = {
  +        http.routers.router1 = {
  +          rule = "Host(`localhost`)";
  +          service = "service1";
           };
  -        backends.backend1 = {
  -          servers.server1.url = "http://localhost:8000";
  -        };
  +
  +        http.services.service1.loadBalancer.servers =
  +          [{ url = "http://localhost:8080"; }];
         };
       };
   
  
positive.code:       isSystemUser = true;
      };
  
      users.groups.traefik = {};
    };
  }
  
negative.code:   };
  
    config = mkIf cfg.enable {
      systemd.tmpfiles.rules = [ "d '${cfg.dataDir}' 0700 traefik traefik - -" ];
  
      systemd.services.traefik = {
        description = "Traefik web server";
        after = [ "network-online.target" ];
        wantedBy = [ "multi-user.target" ];
        serviceConfig = {
          ExecStart =
            "${cfg.package}/bin/traefik --configfile=${staticConfigFile}";
          Type = "simple";
          User = "traefik";
          Group = cfg.group;
  