Automatically generated hosts
file for Wireguard VPN
This commit is contained in:
parent
7ab5ee99d6
commit
a123364777
1 changed files with 14 additions and 1 deletions
|
@ -1,4 +1,9 @@
|
|||
{config, ...}: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
vpn,
|
||||
...
|
||||
}: {
|
||||
networking.firewall.interfaces.wg0 = {
|
||||
allowedUDPPortRanges = [
|
||||
{
|
||||
|
@ -18,4 +23,12 @@
|
|||
privateKeyFile = config.age.secrets."${config.networking.hostName}-wireguard-private-key".path;
|
||||
listenPort = 51820;
|
||||
};
|
||||
|
||||
networking.hosts =
|
||||
lib.mapAttrs'
|
||||
(hostname: vpnConfig: {
|
||||
name = vpnConfig.ip;
|
||||
value = ["${hostname}.fleet"];
|
||||
})
|
||||
vpn;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue