configuration.nix/hosts/rico2/wireguard.nix
2023-10-10 19:14:58 +05:30

23 lines
445 B
Nix

{
config,
secrets,
...
}: let
inherit (secrets.wireguard_config) peers;
in {
networking.wireguard = {
enable = true;
interfaces = {
wg0 = {
inherit (peers."${config.networking.hostName}") ips;
privateKeyFile = "/etc/wireguard/private.key";
generatePrivateKeyFile = true;
listenPort = 51820;
peers = with peers; [
Proxy
Skipper
];
};
};
};
}