configuration.nix/hosts/skipper/wireguard.nix

24 lines
464 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-10-10 22:39:59 +05:30
inherit (peers."${config.networking.hostName}") ips listenPort;
privateKeyFile = "/etc/wireguard/private.key";
generatePrivateKeyFile = true;
peers = with peers; [
Proxy.peer
];
};
};
};
}