diff --git a/nix/deuxfleurs.nix b/nix/deuxfleurs.nix index 7c2919c..0b5169f 100644 --- a/nix/deuxfleurs.nix +++ b/nix/deuxfleurs.nix @@ -117,6 +117,11 @@ in description = "List of users having an admin account on cluster nodes, maps user names to a list of authorized SSH keys"; type = types.attrsOf (types.listOf types.str); }; + bootstrap = mkOption { + description = "Whether to enable bootstrapping for Nomad and Consul"; + type = types.bool; + default = false; + }; }; config = { @@ -187,10 +192,8 @@ in services.consul.enable = true; services.consul.extraConfig = (if cfg.is_raft_server - then { - server = true; - bootstrap_expect = 3; - } + then { server = true; } + // (if cfg.bootstrap then { bootstrap_expect = 3; } else {}) else {}) // { datacenter = cfg.cluster_name; @@ -235,11 +238,10 @@ in ]; services.nomad.settings = (if cfg.is_raft_server - then { server = { - enabled = true; - bootstrap_expect = 3; - }; } - else {}) // + then { + server = { enabled = true; } + // (if cfg.bootstrap then { bootstrap_expect = 3; } else {}); + } else {}) // { region = cfg.cluster_name; datacenter = cfg.site_name;