2023-03-07 02:26:07 +02:00
|
|
|
{ config, depot, ... }:
|
2022-08-03 23:53:45 +03:00
|
|
|
|
|
|
|
let
|
2023-03-07 02:26:07 +02:00
|
|
|
inherit (depot.config) hours;
|
2022-08-03 23:53:45 +03:00
|
|
|
|
|
|
|
meshNet = rec {
|
|
|
|
netAddr = "10.1.1.0";
|
|
|
|
prefix = 24;
|
|
|
|
cidr = "${netAddr}/${toString prefix}";
|
|
|
|
};
|
|
|
|
|
2023-03-07 02:26:07 +02:00
|
|
|
getExtAddr = host: host.interfaces.primary.addrPublic;
|
2022-08-03 23:53:45 +03:00
|
|
|
in
|
|
|
|
{
|
2022-08-05 00:25:37 +03:00
|
|
|
vars = {
|
|
|
|
mesh = {
|
2023-03-01 02:02:41 +02:00
|
|
|
checkmate = config.links.mesh-node-checkmate.extra;
|
2023-03-22 00:56:19 +02:00
|
|
|
thunderskin = config.links.mesh-node-thunderskin.extra;
|
2022-08-05 00:25:37 +03:00
|
|
|
VEGAS = config.links.mesh-node-VEGAS.extra;
|
|
|
|
prophet = config.links.mesh-node-prophet.extra;
|
|
|
|
};
|
|
|
|
inherit meshNet;
|
2022-08-04 00:36:11 +03:00
|
|
|
};
|
2022-08-03 23:53:45 +03:00
|
|
|
links = {
|
2023-03-01 02:02:41 +02:00
|
|
|
mesh-node-checkmate = {
|
2023-03-07 02:26:07 +02:00
|
|
|
ipv4 = getExtAddr hours.checkmate;
|
2023-03-01 02:02:41 +02:00
|
|
|
extra = {
|
|
|
|
meshIp = "10.1.1.32";
|
|
|
|
inherit meshNet;
|
|
|
|
pubKey = "fZMB9CDCWyBxPnsugo3Uxm/TIDP3VX54uFoaoC0bP3U=";
|
|
|
|
privKeyFile = ./mesh-keys/checkmate.age;
|
|
|
|
extraRoutes = [];
|
|
|
|
};
|
|
|
|
};
|
2023-03-20 20:52:07 +02:00
|
|
|
mesh-node-thunderskin = {
|
|
|
|
ipv4 = getExtAddr hours.thunderskin;
|
|
|
|
extra = {
|
|
|
|
meshIp = "10.1.1.4";
|
|
|
|
inherit meshNet;
|
|
|
|
pubKey = "xvSsFvCVK8h2wThZJ7E5K0fniTBIEIYOblkKIf3Cwy0=";
|
|
|
|
privKeyFile = ./mesh-keys/thunderskin.age;
|
|
|
|
extraRoutes = [];
|
|
|
|
};
|
|
|
|
};
|
2022-08-03 23:53:45 +03:00
|
|
|
mesh-node-VEGAS = {
|
2023-03-07 02:26:07 +02:00
|
|
|
ipv4 = getExtAddr hours.VEGAS;
|
2022-08-03 23:53:45 +03:00
|
|
|
extra = {
|
|
|
|
meshIp = "10.1.1.5";
|
|
|
|
inherit meshNet;
|
|
|
|
pubKey = "NpeB8O4erGTas1pz6Pt7qtY9k45YV6tcZmvvA4qXoFk=";
|
|
|
|
privKeyFile = ./mesh-keys/VEGAS.age;
|
2023-03-07 02:26:07 +02:00
|
|
|
extraRoutes = [ "${hours.VEGAS.interfaces.vstub.addr}/32" "10.10.0.0/16" ];
|
2022-08-03 23:53:45 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
mesh-node-prophet = {
|
2023-03-07 02:26:07 +02:00
|
|
|
ipv4 = getExtAddr hours.prophet;
|
2022-08-03 23:53:45 +03:00
|
|
|
extra = {
|
|
|
|
meshIp = "10.1.1.9";
|
|
|
|
inherit meshNet;
|
|
|
|
pubKey = "MMZAbRtNE+gsLm6DJy9VN/Y39E69oAZnvOcFZPUAVDc=";
|
|
|
|
privKeyFile = ./mesh-keys/prophet.age;
|
2022-08-04 01:27:21 +03:00
|
|
|
extraRoutes = [];
|
2022-08-03 23:53:45 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
services.wireguard = {
|
|
|
|
nodes = {
|
2023-03-20 20:52:07 +02:00
|
|
|
mesh = [ "checkmate" "thunderskin" "VEGAS" "prophet" ];
|
2022-08-03 23:53:45 +03:00
|
|
|
};
|
|
|
|
nixos = {
|
|
|
|
mesh = ./mesh.nix;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|