2023-10-10 18:25:21 +05:30
|
|
|
{
|
|
|
|
config,
|
|
|
|
secrets,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (secrets.wireguard_config) peers;
|
|
|
|
in {
|
|
|
|
networking.wireguard = {
|
|
|
|
enable = true;
|
|
|
|
interfaces = {
|
|
|
|
wg0 = {
|
2023-10-10 19:38:13 +05:30
|
|
|
inherit (peers."${config.networking.hostName}") ips listenPort;
|
2023-10-10 18:25:21 +05:30
|
|
|
privateKeyFile = "/etc/wireguard/private.key";
|
|
|
|
generatePrivateKeyFile = true;
|
|
|
|
peers = with peers; [
|
2023-10-10 19:18:36 +05:30
|
|
|
Proxy.peer
|
2023-10-10 18:25:21 +05:30
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|