configuration.nix/hosts/skipper/wireguard.nix

23 lines
415 B
Nix
Raw Normal View History

2023-10-08 15:35:56 +05:30
{
config,
secrets,
...
}: let
2023-10-08 15:43:30 +05:30
inherit (secrets.wireguard_config) peers Proxy Rico2;
2023-10-08 15:35:56 +05:30
in {
networking.wireguard = {
2023-10-08 13:21:45 +05:30
enable = true;
interfaces = {
wg0 = {
2023-10-08 15:35:56 +05:30
inherit (peers."${config.networking.hostName}") 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 = [
2023-10-08 15:35:56 +05:30
Proxy
2023-10-08 15:43:30 +05:30
Rico2
2023-10-08 13:42:23 +05:30
];
2023-10-08 13:21:45 +05:30
};
};
};
}