nixos-configs/nixos/wireguard.nix

50 lines
1.3 KiB
Nix
Raw Normal View History

2024-10-26 18:33:47 +00:00
{
lib,
config,
...
}: {
2024-10-26 18:24:13 +00:00
networking = {
useDHCP = lib.mkDefault true;
2024-10-26 18:33:47 +00:00
networkmanager.unmanaged = ["tailscale0"];
2024-10-26 18:24:13 +00:00
wg-quick.interfaces = {
home = {
privateKeyFile = config.sops.secrets."wireguard/home/privateKey".path;
2024-10-26 18:33:47 +00:00
address = ["10.225.191.4/24"];
dns = ["192.168.30.131"];
2024-10-26 18:24:13 +00:00
autostart = false;
mtu = 1412;
2024-10-26 18:33:47 +00:00
peers = [
{
presharedKeyFile = config.sops.secrets."wireguard/home/presharedKey".path;
endpoint = "wg.kun.is:51820";
publicKey = "fa3mQ7ximJbH7cu2ZbWidto5xBGxEEfWvCCiUDk00Hg=";
allowedIPs = ["0.0.0.0/0"];
}
];
2024-10-26 18:24:13 +00:00
};
home-no-pihole = {
privateKeyFile = config.sops.secrets."wireguard/home/privateKey".path;
2024-10-26 18:33:47 +00:00
address = ["10.225.191.4/24"];
dns = ["192.168.10.1"];
2024-10-26 18:24:13 +00:00
autostart = false;
mtu = 1412;
2024-10-26 18:33:47 +00:00
peers = [
{
presharedKeyFile = config.sops.secrets."wireguard/home/presharedKey".path;
endpoint = "wg.kun.is:51820";
publicKey = "fa3mQ7ximJbH7cu2ZbWidto5xBGxEEfWvCCiUDk00Hg=";
allowedIPs = ["0.0.0.0/0"];
}
];
2024-10-26 18:24:13 +00:00
};
};
};
sops.secrets = {
2024-10-26 18:33:47 +00:00
"wireguard/home/presharedKey" = {};
"wireguard/home/privateKey" = {};
2024-10-26 18:24:13 +00:00
};
}