refactor wireguard configs
This commit is contained in:
parent
5884834b71
commit
b6e5604c02
1 changed files with 10 additions and 7 deletions
|
@ -1,16 +1,19 @@
|
||||||
{secrets, ...}: {
|
{
|
||||||
networking.wireguard = let
|
config,
|
||||||
inherit (secrets.wireguard_config) server;
|
secrets,
|
||||||
inherit (secrets.wireguard_config) peers;
|
...
|
||||||
in {
|
}: let
|
||||||
|
inherit (secrets.wireguard_config) peers Proxy;
|
||||||
|
in {
|
||||||
|
networking.wireguard = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interfaces = {
|
interfaces = {
|
||||||
wg0 = {
|
wg0 = {
|
||||||
inherit (peers."1") ips;
|
inherit (peers."${config.networking.hostName}") ips;
|
||||||
privateKeyFile = "/etc/wireguard/private.key";
|
privateKeyFile = "/etc/wireguard/private.key";
|
||||||
generatePrivateKeyFile = true;
|
generatePrivateKeyFile = true;
|
||||||
peers = [
|
peers = [
|
||||||
server
|
Proxy
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue