setup wireguard stuff on rico1

This commit is contained in:
Adithya 2023-10-11 12:10:06 +05:30
parent 910317d5cc
commit 858dbaa2db
Signed by: adtya
GPG key ID: 48FC9915FFD326D0

22
hosts/rico1/wireguard.nix Normal file
View file

@ -0,0 +1,22 @@
{
config,
secrets,
...
}: let
inherit (secrets.wireguard_config) peers;
in {
networking.firewall.trustedInterfaces = ["wg0"];
networking.wireguard = {
enable = true;
interfaces = {
wg0 = {
inherit (peers."${config.networking.hostName}") ips listenPort;
privateKeyFile = "/etc/wireguard/private.key";
generatePrivateKeyFile = true;
peers = with peers; [
Proxy.peer
];
};
};
};
}