layne: test wireguard module

This commit is contained in:
Adithya 2024-07-06 00:29:42 +05:30
parent 7471548c57
commit aae94c69ad
Signed by: adtya
GPG key ID: B8857BFBA2C47B9C
2 changed files with 20 additions and 25 deletions

View file

@ -1,4 +1,6 @@
{ config, ... }: { { config, ... }: {
imports = [ ../shared/wireguard.nix ];
sops.secrets = { sops.secrets = {
"wireguard/layne/pk" = { "wireguard/layne/pk" = {
mode = "400"; mode = "400";
@ -12,31 +14,14 @@
}; };
}; };
networking.firewall.trustedInterfaces = [ "wg0" ]; nodeconfig.wireguard = {
networking.wireguard = {
enable = true; enable = true;
interfaces = { listen-port = 51834;
wg0 = { pk-file = config.sops.secrets."wireguard/layne/pk".path;
ips = [ psk-file = config.sops.secrets."wireguard/layne/psk".path;
"10.10.10.14/24" node-ips = [
"fd7c:585c:c4ae::14/64" "10.10.10.14/24"
]; "fd7c:585c:c4ae::14/64"
listenPort = 51834; ];
privateKeyFile = config.sops.secrets."wireguard/layne/pk".path;
peers = [
{
name = "Proxy";
endpoint = "165.232.180.97:51821";
publicKey = "NNw/iDMCTq8mpHncrecEh4UlvtINX/UUDtCJf2ToFR4=";
presharedKeyFile = config.sops.secrets."wireguard/layne/psk".path;
persistentKeepalive = 20;
allowedIPs = [
"10.10.10.0/24"
"fd7c:585c:c4ae::0/64"
];
}
];
};
};
}; };
} }

View file

@ -0,0 +1,10 @@
_: {
nodeconfig.wireguard = {
endpoint = "165.232.180.97:51821";
endpoint-publickey = "NNw/iDMCTq8mpHncrecEh4UlvtINX/UUDtCJf2ToFR4=";
allowed-ips = [
"10.10.10.0/24"
"fd7c:585c:c4ae::0/64"
];
};
}