mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
hosts: update Wireguard setup
This commit is contained in:
parent
213ecb8598
commit
c8b55c278a
@ -201,14 +201,16 @@ in
|
|||||||
networking.wg-quick.interfaces.wireguard0 = {
|
networking.wg-quick.interfaces.wireguard0 = {
|
||||||
privateKeyFile = config.sops.secrets."ni/wireguard/private-key".path;
|
privateKeyFile = config.sops.secrets."ni/wireguard/private-key".path;
|
||||||
|
|
||||||
|
dns = with wireguardPeers.server; [ IPv4 IPv6 ];
|
||||||
|
|
||||||
address = with wireguardPeers.desktop; [
|
address = with wireguardPeers.desktop; [
|
||||||
"${IPv4}/32"
|
"${IPv4}/24"
|
||||||
"${IPv6}/128"
|
"${IPv6}/96"
|
||||||
];
|
];
|
||||||
|
|
||||||
peers = [
|
peers = [
|
||||||
{
|
{
|
||||||
publicKey = lib.readFile ../plover/files/wireguard/wireguard-public-key-plover;
|
publicKey = lib.removeSuffix "\n" (lib.readFile ../plover/files/wireguard/wireguard-public-key-plover);
|
||||||
presharedKeyFile = config.sops.secrets."ni/wireguard/preshared-keys/plover".path;
|
presharedKeyFile = config.sops.secrets."ni/wireguard/preshared-keys/plover".path;
|
||||||
allowedIPs = wireguardAllowedIPs;
|
allowedIPs = wireguardAllowedIPs;
|
||||||
endpoint = "${interfaces.main'.IPv4.address}:${toString wireguardPort}";
|
endpoint = "${interfaces.main'.IPv4.address}:${toString wireguardPort}";
|
||||||
|
@ -9,8 +9,8 @@ let
|
|||||||
|
|
||||||
wireguardIFName = "wireguard0";
|
wireguardIFName = "wireguard0";
|
||||||
|
|
||||||
desktopPeerAddresses = with wireguardPeers.desktop; [ "${IPv4}/32" "${IPv6}/128" ];
|
desktopPeerAddresses = with wireguardPeers.desktop; [ "${IPv4}/24" "${IPv6}/96" ];
|
||||||
phonePeerAddresses = with wireguardPeers.phone; [ "${IPv4}/32" "${IPv6}/128" ];
|
phonePeerAddresses = with wireguardPeers.phone; [ "${IPv4}/24" "${IPv6}/96" ];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
environment.systemPackages = [ pkgs.wireguard-tools ];
|
environment.systemPackages = [ pkgs.wireguard-tools ];
|
||||||
|
Loading…
Reference in New Issue
Block a user