configuration.nix/hosts/rico2/wireguard.nix

23 lines
466 B
Nix
Raw Normal View History

{
config,
secrets,
...
}: let
inherit (secrets.wireguard_config) peers;
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
];
};
};
};
}