configuration.nix/hosts/skipper/wireguard.nix

19 lines
395 B
Nix
Raw Normal View History

2023-10-08 13:42:23 +05:30
{secrets, ...}: {
networking.wireguard = let
inherit (secrets.wireguard_config) server;
inherit (secrets.wireguard_config) peers;
in {
2023-10-08 13:21:45 +05:30
enable = true;
interfaces = {
wg0 = {
2023-10-08 13:42:23 +05:30
inherit (peers."1") ips;
2023-10-08 13:21:45 +05:30
privateKeyFile = "/etc/wireguard/private.key";
generatePrivateKeyFile = true;
2023-10-08 13:42:23 +05:30
peers = [
server
];
2023-10-08 13:21:45 +05:30
};
};
};
}