From 2a34c9d427a3d37597c5b499d3cb91113384d558 Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Mon, 30 Nov 2020 21:34:40 +0100 Subject: [PATCH] Add and fix wireguard on hummelberg --- host/hummelberg/networking.nix | 11 +++++++++++ lib/wireguard.nix | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/host/hummelberg/networking.nix b/host/hummelberg/networking.nix index 3ebde6f..61cc2fd 100644 --- a/host/hummelberg/networking.nix +++ b/host/hummelberg/networking.nix @@ -12,4 +12,15 @@ # Configure network proxy if necessary # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + networking.wireguard.enable = true; + networking.wireguard.interfaces = let + meta = import ../../meta; + vnetworks = meta.network.virtual; + vnetworkName = "mgmt"; + in { + "wg-${vnetworkName}" = + pkgs.lib.qois.wireguard.makeInterface config.networking.hostName + vnetworkName vnetworks.${vnetworkName}; + }; } diff --git a/lib/wireguard.nix b/lib/wireguard.nix index 0113ca0..d927f9c 100644 --- a/lib/wireguard.nix +++ b/lib/wireguard.nix @@ -9,7 +9,7 @@ endpoint = hostconf.endpoint; allowedIPs = [ hostconf.v4.ip ]; - persistantKeepalive = hostconf.persistentKeepalive; + persistentKeepalive = hostconf.persistentKeepalive; }); makeInterface = (hostName: netname: netconfig: {