refactor wireguard configs

This commit is contained in:
Adithya 2023-10-08 15:35:56 +05:30
parent 5884834b71
commit b6e5604c02
Signed by: adtya
GPG key ID: 48FC9915FFD326D0

View file

@ -1,16 +1,19 @@
{secrets, ...}: {
networking.wireguard = let
inherit (secrets.wireguard_config) server;
inherit (secrets.wireguard_config) peers;
in {
{
config,
secrets,
...
}: let
inherit (secrets.wireguard_config) peers Proxy;
in {
networking.wireguard = {
enable = true;
interfaces = {
wg0 = {
inherit (peers."1") ips;
inherit (peers."${config.networking.hostName}") ips;
privateKeyFile = "/etc/wireguard/private.key";
generatePrivateKeyFile = true;
peers = [
server
Proxy
];
};
};