feat: add home wireguard config

This commit is contained in:
EinEtwas 2024-10-26 11:54:46 +02:00
parent c96901ee06
commit 23c140a2d1
Signed by: etwas
SSH key fingerprint: SHA256:bHhIeAdn/2k9jmOs6+u6ox98VYmoHUN3HfnpV2w8Ws0
5 changed files with 28 additions and 1 deletions

View file

@ -5,6 +5,9 @@
age.secrets.access-tokens-github.file = ../secrets/gh_argstr.age;
age.secrets.fbda-wg-privkey.file = ../secrets/fbda_wg_priv_key.age;
age.secrets.fbda-wg-psk.file = ../secrets/fbda_wg_psk.age;
age.secrets.obvps-id = {
file = ../secrets/1bvps.age;
path = "/home/rhea/.ssh/id_1bvps";

View file

@ -1,6 +1,28 @@
{ config, ... }:
{
# Enable networking
networking.networkmanager.enable = true;
networking.networkmanager.wifi.powersave = true;
networking.wireguard.enable = true;
networking.firewall = {
allowedUDPPorts = [ 51820 ]; # Clients and peers can use the same port, see listenport
};
networking.wireguard.interfaces."wg0" = {
privateKeyFile = "/run/agenix/fbda-wg-privkey";
ips = [ "192.168.178.201/24" ];
listenPort = 51820;
peers = [
{
publicKey = "wwx1Kns34xmK+UJsF4l89uIZ5oc/m8VA9q7+YPWCbX8=";
presharedKeyFile = "/run/agenix/fbda-wg-psk";
allowedIPs = [ "192.168.178.0/24" "0.0.0.0/0" ];
endpoint = "y92dby3elaoma4gg.myfritz.net:57667";
persistentKeepalive = 25;
}
];
};
}

Binary file not shown.

BIN
secrets/fbda_wg_psk.age Normal file

Binary file not shown.

View file

@ -8,4 +8,6 @@ in
"1bvps.age".publicKeys = [ rhea-laptop ];
"gcd_etwas.age".publicKeys = [ rhea-laptop ];
"sign_etwas.age".publicKeys = [ rhea-laptop ];
"fbda_wg_priv_key.age".publicKeys = [ rhea-laptop ];
"fbda_wg_psk.age".publicKeys = [ rhea-laptop ];
}