anchor.diff:        + ''
           echo "}" >> /etc/consul-addrs.json
         '';
  -      postStart = ''
  -        # Issues joins to nodes which we statically connect to
  -        ${flip concatMapStrings cfg.joinNodes (addr: ''
  -          for i in {0..${toString cfg.joinRetries}}; do
  -            # Try to join the other nodes ${toString cfg.joinRetries} times before failing
  -            consul join "${addr}" && break
  -            sleep 1
  -          done &
  -        '')}
  -        wait
  -        exit 0
  -      '';
       };
   
       systemd.services.consul-alerts = mkIf (cfg.alerts.enable) {
  
positive.code:           it from the cluster. You probably don't want this option unless you
            are running a node which going offline in a permanent / semi-permanent
            fashion.
          '';
        };
  
        joinNodes = mkOption {
          type = types.listOf types.str;
          default = [ ];
          description = ''
            A list of addresses of nodes which should be joined at startup if the
            current node is in a left state.
          '';
        };
  
        joinRetries = mkOption {
          type = types.int;
          default = 10;
          description = ''
            The number of times to retry connecting to the join nodes.
          '';
        };
  
  
negative.code:   dataDir = "/var/lib/consul";
    cfg = config.services.consul;
  
    configOptions = { data_dir = dataDir; } //
      (if cfg.webUi then { ui_dir = "${pkgs.consul.ui}"; } else { }) //
      cfg.extraConfig;
  
    configFiles = [ "/etc/consul.json" "/etc/consul-addrs.json" ]
      ++ cfg.extraConfigFiles;
  