1
0
Fork 0
mirror of https://git.oat.zone/dark-firepit/dotfiles synced 2024-05-06 05:26:07 +02:00
git.oat.zone--dark-firepit-.../hosts/dark-firepit/wireguardInterface.nix
System administrator 9da0a143ae some refactoring
Co-authored-by: Jill Monoids <oatmealine@disroot.org>
2022-09-05 18:27:22 +02:00

19 lines
355 B
Nix

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