anchor.diff:        after    = [ "network.target" ];
         script = ''
           ${pkgs.prometheus-alertmanager.bin}/bin/alertmanager \
  -        -config.file ${mkConfigFile} \
  +        -config.file ${alertmanagerYml} \
           -web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
           -log.level ${cfg.logLevel} \
           ${optionalString (cfg.webExternalUrl != null) ''-web.external-url ${cfg.webExternalUrl} \''}
  
positive.code:         default = {};
          description = ''
            Alertmanager configuration as nix attribute set.
          '';
        };
  
  
negative.code: let
    cfg = config.services.prometheus.alertmanager;
    mkConfigFile = pkgs.writeText "alertmanager.yml" (builtins.toJSON cfg.configuration);
    alertmanagerYml =
      if cfg.configText != null then
        pkgs.writeText "alertmanager.yml" cfg.configText
      else mkConfigFile;
  in {
    options = {
      services.prometheus.alertmanager = {
  