hosts/ni: update Wireguard interface

This commit is contained in:
Gabriel Arazas 2023-05-21 06:37:03 +08:00
parent fa7b1796b4
commit 670361faaa
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -215,12 +215,6 @@ in
# others might be using systemd-networkd).
networking.wg-quick.interfaces.wireguard0 = {
privateKeyFile = config.sops.secrets."ni/wireguard/private-key".path;
dns = with interfaces.internal; [
IPv4.address
IPv6.address
];
listenPort = wireguardPort;
address = with wireguardPeers.desktop; [
@ -229,12 +223,20 @@ in
];
peers = [
# The "server" peer.
{
publicKey = lib.removeSuffix "\n" (lib.readFile ../plover/files/wireguard/wireguard-public-key-plover);
presharedKeyFile = config.sops.secrets."ni/wireguard/preshared-keys/plover".path;
allowedIPs = wireguardAllowedIPs;
endpoint = "${interfaces.main'.IPv4.address}:${toString wireguardPort}";
}
# The "phone" peer.
{
publicKey = lib.removeSuffix "\n" (lib.readFile ../plover/files/wireguard/wireguard-public-key-phone);
presharedKeyFile = config.sops.secrets."ni/wireguard/preshared-keys/phone".path;
allowedIPs = wireguardAllowedIPs;
}
];
};
}