anchor.diff:                concatStringsSep " \\\n  " cmdlineArgs2);
             User = promUser;
             Restart  = "always";
  -          WorkingDirectory = /var/lib/prometheus2;
  -          StateDirectory = "prometheus2";
  +          WorkingDirectory = workingDir2;
  +          StateDirectory = cfg2.stateDir;
           };
         };
       })
  
positive.code:         '';
        };
  
        extraFlags = mkOption {
          type = types.listOf types.str;
          default = [];
  
negative.code:       };
      })
      (mkIf cfg.enable {
        warnings =
          optional (cfg.dataDir != null) ''
            The option services.prometheus.dataDir is deprecated, please use
            services.prometheus.stateDir.
          '';
        assertions = [
          {
            assertion = !(cfg.dataDir != null && cfg.stateDir != null);
            message =
              "The options services.prometheus.dataDir and services.prometheus.stateDir" +
              " can't both be set at the same time! It's recommended to only set the latter" +
              " since the former is deprecated.";
          }
          {
            assertion = cfg.dataDir != null -> hasPrefix stateDirBase cfg.dataDir;
            message =
              "The option services.prometheus.dataDir should have ${stateDirBase} as a prefix!";
          }
          {
            assertion = cfg.stateDir != null -> !hasPrefix "/" cfg.stateDir;
            message =
              "The option services.prometheus.stateDir shouldn't be an absolute directory." +
              " It should be a directory relative to ${stateDirBase}.";
          }
          {
            assertion = cfg2.stateDir != null -> !hasPrefix "/" cfg2.stateDir;
            message =
              "The option services.prometheus2.stateDir shouldn't be an absolute directory." +
              " It should be a directory relative to ${stateDirBase}.";
          }
        ];
        systemd.services.prometheus = {
          wantedBy = [ "multi-user.target" ];
          after    = [ "network.target" ];
  