configuration.nix/hosts/rico2/wireguard.nix

28 lines
501 B
Nix
Raw Normal View History

2023-11-04 16:12:45 +05:30
{ config
, secrets
, ...
}:
let
inherit (secrets.wireguard_config) peers;
2023-11-04 16:12:45 +05:30
in
{
networking.firewall.trustedInterfaces = [ "wg0" ];
networking.wireguard = {
enable = true;
interfaces = {
wg0 = {
2023-11-12 15:04:59 +05:30
ips = [
2024-01-04 21:51:21 +05:30
"10.8.10.12/24"
2024-01-04 21:51:15 +05:30
"fdd9:69ae:9703::5/64"
2023-11-12 15:04:59 +05:30
];
listenPort = 51821;
privateKeyFile = "/etc/wireguard/private.key";
generatePrivateKeyFile = true;
peers = with peers; [
2023-11-12 15:04:59 +05:30
Proxy
];
};
};
};
}