aboutsummaryrefslogtreecommitdiff
path: root/configuration.nix
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-11-18 16:40:19 +0100
committerAlex Auvolat <alex@adnab.me>2021-11-18 16:40:19 +0100
commitcdd4e2211ac90d55f528bb880d86ef1bf524c484 (patch)
treed49eddf2a3bc54fa1c5b6d89d93eeec530676a4d /configuration.nix
parent777896a434d6d7ac603557546b2aa0525de62966 (diff)
downloadnixcfg-cdd4e2211ac90d55f528bb880d86ef1bf524c484.tar.gz
nixcfg-cdd4e2211ac90d55f528bb880d86ef1bf524c484.zip
Nomad config
Diffstat (limited to 'configuration.nix')
-rw-r--r--configuration.nix14
1 files changed, 7 insertions, 7 deletions
diff --git a/configuration.nix b/configuration.nix
index be424f8..b55c15e 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -6,6 +6,7 @@
# Configuration local for this cluster node (hostname, IP, etc)
let node_config = import ./node.nix args;
+ site_config = import ./site.nix args;
in
{
imports =
@@ -13,6 +14,8 @@ in
./hardware-configuration.nix
# Configuration local for this cluster node (hostname, IP, etc)
./node.nix
+ # Configuration local for this Deuxfleurs site (set of nodes)
+ ./site.nix
];
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
@@ -210,11 +213,9 @@ in
# Enable Hashicorp Consul & Nomad
services.consul.enable = true;
services.consul.extraConfig =
- let public_ip = (builtins.head node_config.networking.wireguard.interfaces.wg0.ips);
+ let public_ip = (builtins.head (builtins.split "/" (builtins.head node_config.networking.wireguard.interfaces.wg0.ips)));
in
{
- datacenter = "neptune";
- bootstrap_expect = 3;
server = true;
ui = true;
bind_addr = public_ip;
@@ -224,13 +225,12 @@ in
services.nomad.enable = true;
services.nomad.settings =
- let public_ip = (builtins.head node_config.networking.wireguard.interfaces.wg0.ips);
+ let public_ip = (builtins.head (builtins.split "/" (builtins.head node_config.networking.wireguard.interfaces.wg0.ips)));
in
{
- datacenter = "neptune";
+ region = site_config.services.nomad.settings.datacenter;
server = {
enabled = true;
- bootstrap_expect = 3;
};
advertise = {
rpc = public_ip;
@@ -240,7 +240,7 @@ in
consul.address = "127.0.0.1:8500";
client = {
enabled = true;
- network_interface = "eno1";
+ network_interface = "wg0";
};
plugin = [
{