18 lines
395 B
Nix
18 lines
395 B
Nix
{secrets, ...}: {
|
|
networking.wireguard = let
|
|
inherit (secrets.wireguard_config) server;
|
|
inherit (secrets.wireguard_config) peers;
|
|
in {
|
|
enable = true;
|
|
interfaces = {
|
|
wg0 = {
|
|
inherit (peers."1") ips;
|
|
privateKeyFile = "/etc/wireguard/private.key";
|
|
generatePrivateKeyFile = true;
|
|
peers = [
|
|
server
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|