Setup Wireguard configuration
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@
|
||||
imports = [
|
||||
./sops.nix
|
||||
./locale.nix
|
||||
./tailscale.nix
|
||||
./wireguard.nix
|
||||
./ssh.nix
|
||||
./impermanence.nix
|
||||
]
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
sops.secrets.tailscale_auth_key = { };
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
authKeyFile = config.sops.secrets.tailscale_auth_key.path;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{ config, hostName, ... }:
|
||||
{
|
||||
sops.secrets."wireguard/${hostName}" = {
|
||||
mode = "0400";
|
||||
};
|
||||
|
||||
networking = {
|
||||
wireguard.interfaces.wg0 = {
|
||||
privateKeyFile = config.sops.secrets."wireguard/${hostName}".path;
|
||||
};
|
||||
firewall.allowedUDPPorts = [ 51820 ];
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user