feat: wireguard test

This commit is contained in:
Nick 2025-07-01 13:54:00 -05:00
parent 93366c81c8
commit c6ea717181
11 changed files with 26 additions and 22 deletions

View file

@ -1,27 +1,26 @@
{ config, flake, ... }:
let
inherit (flake.config.services.instances) wireGuard web;
inherit (flake.config.machines.devices) mars;
inherit (flake.config.machines.devices) ceres mars;
service = wireGuard;
in
{
networking = {
wg-quick.interfaces = {
wg0 = {
address = [ "${mars.wireguard.ip0}/24" ];
privateKeyFile = config.sops.secrets."${service.name}-mars-private".path;
peers = [
{
publicKey = "fs58+Kz+eG9qAXvvMB2NkW+wa88yP61uam4HHWaBJVw=";
allowedIPs = [
"10.100.0.0/24"
"192.168.1.0/24"
];
endpoint = "${web.remotehost.address0}:${builtins.toString service.ports.port0}";
persistentKeepalive = 25;
}
];
};
wireguard.interfaces.wg0 = {
ips = [ "${mars.wireguard.ip0}/24" ];
privateKeyFile = config.sops.secrets."${service.name}-mars-private".path;
peers = [
{
publicKey = "fs58+Kz+eG9qAXvvMB2NkW+wa88yP61uam4HHWaBJVw=";
allowedIPs = [
"10.100.0.0/24"
"${ceres.wireguard.ip0}/24"
"192.168.1.0/24"
];
endpoint = "${web.remotehost.address0}:${builtins.toString service.ports.port1}";
persistentKeepalive = 25;
}
];
};
};