setup wireguard peers

This commit is contained in:
Adithya 2023-10-08 13:42:23 +05:30
parent 21fb2ec1e4
commit 73090f76d4
Signed by: adtya
GPG key ID: 48FC9915FFD326D0

View file

@ -1,14 +1,17 @@
_: {
networking.wireguard = {
{secrets, ...}: {
networking.wireguard = let
inherit (secrets.wireguard_config) server;
inherit (secrets.wireguard_config) peers;
in {
enable = true;
interfaces = {
wg0 = {
ips = [
"10.8.1.2/24"
"fdd9:69ae:9703::2/64"
];
inherit (peers."1") ips;
privateKeyFile = "/etc/wireguard/private.key";
generatePrivateKeyFile = true;
peers = [
server
];
};
};
};