From cf279c4fb0abc42af9d3f2ed9d22a437e12a415b Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 5 May 2026 02:11:41 +0000 Subject: [PATCH] feat: add host-level WireGuard client via networking.wireguard - Add wg0 interface config with agenix-managed secrets - Revert compose submodule to remove NET_ADMIN from Hermes - WireGuard runs at host level, all containers inherit the tunnel --- assets/compose | 2 +- hosts/lazyworkhorse/configuration.nix | 35 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/assets/compose b/assets/compose index acf45ac..bc49391 160000 --- a/assets/compose +++ b/assets/compose @@ -1 +1 @@ -Subproject commit acf45acdd961a99c7b3edc3134009e5c1f9d9407 +Subproject commit bc49391b4f67f1db5d9bfcd35a299367210da330 diff --git a/hosts/lazyworkhorse/configuration.nix b/hosts/lazyworkhorse/configuration.nix index 7fdf7ba..69e113e 100644 --- a/hosts/lazyworkhorse/configuration.nix +++ b/hosts/lazyworkhorse/configuration.nix @@ -49,6 +49,27 @@ networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. networking.hostId = "deadbeef"; + # WireGuard VPN client -- always up, connects to wg-easy server + # Before deploying, create age-encrypted secrets: + # echo -n "IOWDh8tH19DGphAkEr46zN0pRl61tmbAynrMkaFo30M=" | agenix -e secrets/wireguard_private_key.age + # echo -n "TIE9hcyOESofAiyJ1Md4CcPruTRXG63rItV9rmV3UDk=" | agenix -e secrets/wireguard_preshared_key.age + networking.wireguard.interfaces = { + wg0 = { + ips = [ "10.8.0.3/24" ]; + privateKeyFile = config.age.secrets.wireguard_private_key.path; + peers = [ + { + publicKey = "rY9zII3AOm8rog2rv02PyA3Bq7zdvTOGkZapfCV1DkE="; + presharedKeyFile = config.age.secrets.wireguard_preshared_key.path; + allowedIPs = [ "0.0.0.0/0" "::/0" ]; + endpoint = "vpn.lazyworkhorse.net:51820"; + persistentKeepalive = 25; + } + ]; + dns = [ "1.1.1.1" "8.8.8.8" ]; + }; + }; + # Set your time zone. time.timeZone = "America/Montreal"; @@ -269,6 +290,20 @@ mode = "0440"; path = "/run/secrets/openclaw_gateway_token"; }; + wireguard_private_key = { + file = ../../secrets/wireguard_private_key.age; + owner = "root"; + group = "root"; + mode = "0400"; + path = "/run/secrets/wireguard_private_key"; + }; + wireguard_preshared_key = { + file = ../../secrets/wireguard_preshared_key.age; + owner = "root"; + group = "root"; + mode = "0400"; + path = "/run/secrets/wireguard_preshared_key"; + }; }; };