Added vpn vm with wstunnel server
This commit is contained in:
1 parent
a75b839bc1
commit
01374fe5b0
4 files changed
+65
-4
No files matched your search
@@ -10,8 +10,21 @@
|
||||
# Admin users
|
||||
users.users.jan.extraGroups = [ "wheel" ];
|
||||
|
||||
# Enable virtualisation for VMs
|
||||
virtualisation.libvirtd.enable = true;
|
||||
|
||||
# Set up wstunnel client
|
||||
services.wstunnel = {
|
||||
enable = true;
|
||||
clients.wg-tunnel = {
|
||||
connectTo = "wss://wstunnel.bulthuis.dev:443";
|
||||
localToRemote = [
|
||||
"udp://51820:10.10.40.100:51820"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Module setup
|
||||
modules = {
|
||||
profiles.laptop.enable = true;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# State version
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
# Machine hostname
|
||||
networking.hostName = "vm-vpn";
|
||||
|
||||
# Enabled modules
|
||||
modules = {
|
||||
profiles.vm.enable = true;
|
||||
};
|
||||
|
||||
# Setup wstunnel server
|
||||
services.wstunnel = {
|
||||
enable = true;
|
||||
servers.wg-tunnel = {
|
||||
enableHTTPS = true;
|
||||
listen = {
|
||||
host = "0.0.0.0";
|
||||
port = 8080;
|
||||
};
|
||||
restrictTo = [
|
||||
{
|
||||
host = "10.10.40.100";
|
||||
port = 51820;
|
||||
}
|
||||
];
|
||||
tlsCertificate = "/var/lib/secrets/fullchain.pem";
|
||||
tlsKey = "/var/lib/secrets/key.pem";
|
||||
};
|
||||
};
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 8080 ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
home.stateVersion = "24.11";
|
||||
|
||||
modules.profiles.base.enable = true;
|
||||
}
|
||||
Reference in new issue
Block a user