dotfiles-nix/nix/programs/wireguard/default.nix

23 lines
560 B
Nix
Raw Normal View History

2025-01-23 14:26:51 +00:00
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
wireguard-tools
];
2025-01-24 15:07:23 +00:00
networking.wg-quick.interfaces = {
2025-01-23 14:26:51 +00:00
freyanet = {
2025-01-24 15:07:23 +00:00
address = [ "10.2.0.2/32" "fd:cafe:dead:bee::2/128" "fe80::2/128" ];
dns = [ "10.2.2.2" ];
2025-01-23 14:26:51 +00:00
privateKeyFile = "${config.dotfilesPath}/secrets/freyanet.key";
peers = [{
publicKey = "x0ykwakpYCvI/pG+nR83lNUyeOE9m54thnX3bvZ+FUk=";
2025-01-24 15:07:23 +00:00
allowedIPs = [ "10.0.0.0/12" "fd:cafe::/32" ];
2025-01-23 14:26:51 +00:00
endpoint = "freya.cat:41111";
persistentKeepalive = 25;
}];
};
};
}