aboutsummaryrefslogtreecommitdiff
path: root/cluster/staging/cluster.nix
diff options
context:
space:
mode:
Diffstat (limited to 'cluster/staging/cluster.nix')
-rw-r--r--cluster/staging/cluster.nix70
1 files changed, 32 insertions, 38 deletions
diff --git a/cluster/staging/cluster.nix b/cluster/staging/cluster.nix
index cf30d6e..56ca904 100644
--- a/cluster/staging/cluster.nix
+++ b/cluster/staging/cluster.nix
@@ -1,49 +1,43 @@
{ config, pkgs, ... } @ args:
{
- deuxfleurs.cluster_name = "staging";
+ deuxfleurs.clusterName = "staging";
# The IP range to use for the Wireguard overlay of this cluster
- deuxfleurs.cluster_prefix = "10.14.0.0";
- deuxfleurs.cluster_prefix_length = 16;
+ deuxfleurs.clusterPrefix = "10.14.0.0/16";
- deuxfleurs.cluster_nodes = [
- {
- hostname = "carcajou";
- site_name = "neptune";
+ deuxfleurs.clusterNodes = {
+ "carcajou" = {
+ siteName = "neptune";
publicKey = "7Nm7pMmyS7Nts1MB+loyD8u84ODxHPTkDu+uqQR6yDk=";
- IP = "10.14.1.2";
+ address = "10.14.1.2";
endpoint = "77.207.15.215:33722";
- }
- {
- hostname = "caribou";
- site_name = "neptune";
+ };
+ "caribou" = {
+ siteName = "neptune";
publicKey = "lABn/axzD1jkFulX8c+K3B3CbKXORlIMDDoe8sQVxhs=";
- IP = "10.14.1.3";
+ address = "10.14.1.3";
endpoint = "77.207.15.215:33723";
- }
- {
- hostname = "origan";
- site_name = "jupiter";
+ };
+ "origan" = {
+ siteName = "jupiter";
publicKey = "smBQYUS60JDkNoqkTT7TgbpqFiM43005fcrT6472llI=";
- IP = "10.14.2.33";
+ address = "10.14.2.33";
endpoint = "82.64.238.84:33733";
- }
- {
- hostname = "piranha";
- site_name = "corrin";
+ };
+ "piranha" = {
+ siteName = "corrin";
publicKey = "m9rLf+233X1VColmeVrM/xfDGro5W6Gk5N0zqcf32WY=";
- IP = "10.14.3.1";
+ address = "10.14.3.1";
#endpoint = "82.120.233.78:33721";
- }
- {
- hostname = "df-pw5";
- site_name = "bespin";
+ };
+ "df-pw5" = {
+ siteName = "bespin";
publicKey = "XLOYoMXF+PO4jcgfSVAk+thh4VmWx0wzWnb0xs08G1s=";
- IP = "10.14.4.1";
+ address = "10.14.4.1";
endpoint = "bitfrost.fiber.shirokumo.net:33734";
- }
- ];
+ };
+ };
services.wgautomesh.logLevel = "debug";
# Bootstrap IPs for Consul cluster,
@@ -54,7 +48,7 @@
"10.14.1.3" # caribou
];
- deuxfleurs.admin_accounts = {
+ deuxfleurs.adminAccounts = {
lx = [
# Keys for accessing nodes from outside
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJpaBZdYxHqMxhv2RExAOa7nkKhPBOHupMP3mYaZ73w9 lx@lindy"
@@ -142,16 +136,16 @@
enable = true;
port = substituter_port;
openFirewall = false;
- bindAddress = config.deuxfleurs.cluster_ip;
+ bindAddress = "0.0.0.0";
package = pkgs.haskellPackages.nix-serve-ng;
};
nix.settings.substituters = map
- ({ IP, ... }: "http://${IP}:${builtins.toString substituter_port}")
- (builtins.filter
- ({ site_name, IP, ...}:
- (IP != config.deuxfleurs.cluster_ip
- && site_name == config.deuxfleurs.site_name))
- config.deuxfleurs.cluster_nodes);
+ ({ address, ... }: "http://${address}:${builtins.toString substituter_port}")
+ (builtins.attrValues (pkgs.lib.filterAttrs
+ (hostname: { siteName, ...}:
+ (hostname != config.deuxfleurs.hostName
+ && siteName == config.deuxfleurs.siteName))
+ config.deuxfleurs.clusterNodes));
})
];
}