2022-04-23 03:01:00 +02:00
|
|
|
{ lib, pkgs, config, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
2022-04-23 03:10:38 +02:00
|
|
|
peerKeys = import ./authorizedKeys.nix;
|
2022-04-23 03:01:00 +02:00
|
|
|
in {
|
|
|
|
ips = [ "10.100.0.1/24" ];
|
|
|
|
|
2022-09-05 18:16:09 +02:00
|
|
|
privateKeyFile = "/etc/wg0.keys/wg0";
|
2022-04-23 03:01:00 +02:00
|
|
|
|
|
|
|
listenPort = 51820;
|
|
|
|
|
|
|
|
peers = genList (n: {
|
2022-04-23 03:10:38 +02:00
|
|
|
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));
|
|
|
|
}
|
2022-09-05 18:16:09 +02:00
|
|
|
|