dotfiles/hosts/dark-firepit/wireguardInterface.nix

19 lines
355 B
Nix
Raw Normal View History

2022-04-23 03:01:00 +02:00
{ lib, pkgs, config, ... }:
with lib;
let
peerKeys = import ./authorizedKeys.nix;
2022-04-23 03:01:00 +02:00
in {
ips = [ "10.100.0.1/24" ];
privateKeyFile = "/etc/wg0.keys/wg0";
2022-04-23 03:01:00 +02:00
listenPort = 51820;
peers = genList (n: {
publicKey = (elemAt (attrValues peerKeys) n).wg;
allowedIPs = [ "10.100.0.${toString (n+2)}/32" ];
2022-04-23 03:01:00 +02:00
}) (length (attrValues peerKeys));
}