2024-03-31 22:28:56 +05:30
|
|
|
{ secrets, ... }:
|
|
|
|
let
|
2024-05-12 15:11:00 +05:30
|
|
|
wireguard_server = secrets.wireguard_server // {
|
2024-03-31 22:28:56 +05:30
|
|
|
persistentKeepalive = 20;
|
|
|
|
allowedIPs = [
|
|
|
|
"10.10.10.0/24"
|
|
|
|
"fd7c:585c:c4ae::0/64"
|
|
|
|
];
|
2024-05-12 15:11:00 +05:30
|
|
|
};
|
2024-03-31 22:28:56 +05:30
|
|
|
in
|
|
|
|
{
|
|
|
|
networking.firewall.trustedInterfaces = [ "wg0" ];
|
|
|
|
networking.wireguard = {
|
|
|
|
enable = true;
|
|
|
|
interfaces = {
|
|
|
|
wg0 = {
|
|
|
|
ips = [
|
|
|
|
"10.10.10.2/24"
|
|
|
|
"fd7c:585c:c4ae::2/64"
|
|
|
|
];
|
|
|
|
listenPort = 51822;
|
2024-06-16 21:25:47 +05:30
|
|
|
privateKeyFile = "/persist/system/etc/wireguard/private.key";
|
2024-03-31 22:28:56 +05:30
|
|
|
generatePrivateKeyFile = true;
|
|
|
|
peers = [
|
|
|
|
wireguard_server
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|