aboutsummaryrefslogtreecommitdiff
path: root/hosts/ganymede/nixos.nix
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-02-27 07:57:56 -0600
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-02-27 07:57:56 -0600
commitc303524a359d2be84d825acebbf8d7e2ddd8f24a (patch)
treeaf7a7537703b7989dff65478a26f5637c0d1abbd /hosts/ganymede/nixos.nix
parent1932c82d72fb74971b180f84e06bcd1724e6271b (diff)
refactor network config, add wireguard connection to vps
Diffstat (limited to 'hosts/ganymede/nixos.nix')
-rw-r--r--hosts/ganymede/nixos.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/hosts/ganymede/nixos.nix b/hosts/ganymede/nixos.nix
index be59083..8b5cbf4 100644
--- a/hosts/ganymede/nixos.nix
+++ b/hosts/ganymede/nixos.nix
@@ -30,6 +30,33 @@
wantedBy = ["default.target"];
};
+ # VPN to server
+ systemd.network = {
+ netdevs."10-wg0" = {
+ netdevConfig = {
+ Kind = "wireguard";
+ Name = "wg0";
+ };
+ wireguardConfig = {
+ PrivateKeyFile = config.collinux.secrets."wireguard-pk".path;
+ ListenPort = 51820;
+ };
+ wireguardPeers = [
+ {
+ PublicKey = "seOq75FUGb+KThvOXCEAGdabWbb+jTRUntITpuAPgWA=";
+ AllowedIPs = "0.0.0.0/0";
+ PersistentKeepalive = 25;
+ }
+ ];
+ };
+ networks."wg0" = {
+ matchConfig.Name = "wg0";
+ address = ["10.100.0.2/24"];
+ DHCP = "no";
+ networkConfig.IPv6AcceptRA = false;
+ };
+ };
+
services.fail2ban.enable = true;
# merge logs from subdomains