inherit (config.boot) initrd;
iface = "wg-intra";
wg = config.networking.wireguard.interfaces.${iface};
- relay =
- hosts.mermet.extraArgs //
- hosts.mermet.config.networking.wireguard.interfaces.${iface} //
- lib.head (lib.filter (peer:
- peer.endpoint != null &&
- builtins.match "^\(.*\):[0-9]*$" peer.endpoint ==
- [hosts.mermet.extraArgs.ipv4])
- wg.peers);
+ wg-intra-hosts = import ../../../../networking/wireguard/wg-intra/hosts.nix;
+ relay = wg-intra-hosts.mermet;
in
{
imports = [
wg set ${iface} private-key /root/initrd/${iface}.key \
listen-port ${toString wg.listenPort}
ip link set up dev ${iface}
- wg set ${iface} peer ${relay.publicKey} \
+ wg set ${iface} peer ${relay.peer.publicKey} \
endpoint ${relay.ipv4}:${toString relay.listenPort} \
allowed-ips ${relay.ipv4}/32 \
persistent-keepalive 5