configuration.nix/hosts/rico2/wireguard.nix

23 lines
420 B
Nix
Raw Normal View History

2023-10-08 15:36:04 +05:30
{
config,
secrets,
...
}: let
2023-10-08 15:51:42 +05:30
inherit (secrets.wireguard_config) peers;
2023-10-08 15:36:04 +05:30
in {
networking.wireguard = {
enable = true;
interfaces = {
wg0 = {
2023-10-08 15:59:18 +05:30
ips = peers."${config.networking.hostName}".allowedIPs;
2023-10-08 15:36:04 +05:30
privateKeyFile = "/etc/wireguard/private.key";
generatePrivateKeyFile = true;
2023-10-08 15:51:42 +05:30
peers = with peers; [
2023-10-08 15:36:04 +05:30
Proxy
Skipper
];
};
};
};
}