configuration.nix/hosts/rico1/wireguard.nix

28 lines
499 B
Nix
Raw Normal View History

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