configuration.nix/hosts/skipper/wireguard.nix

28 lines
499 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 = [
"10.8.1.2/24"
"fdd9:69ae:9703::2/64"
];
listenPort = 51821;
privateKeyFile = "/etc/wireguard/private.key";
generatePrivateKeyFile = true;
peers = with peers; [
2023-11-12 15:04:59 +05:30
Proxy
];
};
};
};
}