diff options
author | ADRN <adrien@luxeylab.net> | 2021-11-28 13:37:11 +0100 |
---|---|---|
committer | ADRN <adrien@luxeylab.net> | 2021-11-28 13:37:11 +0100 |
commit | 839e6918803deee72a6c8444e9a61ca0af75b79d (patch) | |
tree | fc0a0c6baa7d3a17887feeb44b6883e44f792c2f /configuration.nix | |
parent | 9578121f5b99c096447829f7fff6da54b0e9deab (diff) | |
parent | fe080ff4b6ffd435ab62f193072ec22e30b8602f (diff) | |
download | nixcfg-839e6918803deee72a6c8444e9a61ca0af75b79d.tar.gz nixcfg-839e6918803deee72a6c8444e9a61ca0af75b79d.zip |
Merge branch 'main' of git.deuxfleurs.fr:Deuxfleurs/nixcfg into main
Diffstat (limited to 'configuration.nix')
-rw-r--r-- | configuration.nix | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/configuration.nix b/configuration.nix index 5d40366..9c8cb79 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. @@ -187,6 +190,7 @@ in htop links git + docker docker-compose ]; @@ -211,27 +215,25 @@ 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; addresses.http = "0.0.0.0"; retry_join = [ "10.42.0.2" "10.42.0.21" "10.42.0.22" "10.42.0.23" ]; + retry_join_wan = [ "10.42.0.2" "10.42.0.21" "10.42.0.22" "10.42.0.23" ]; }; 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; @@ -241,7 +243,7 @@ in consul.address = "127.0.0.1:8500"; client = { enabled = true; - network_interface = "eno1"; + network_interface = "wg0"; }; plugin = [ { @@ -261,7 +263,7 @@ in # Open ports in the firewall. networking.firewall.allowedTCPPorts = [ (builtins.head ({ openssh.ports = [22]; } // node_config.services).openssh.ports) - 3900 3901 # Garage (internal RPC traffic) + 3990 3991 3992 # Garage 4646 4647 4648 # Nomad 8500 8300 8301 8302 # Consul 19999 # Netdata |