split up wireguard stuff

This commit is contained in:
Simon Gardling 2024-11-14 10:36:54 -05:00
parent e53feb78e4
commit f081e8ff27
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
4 changed files with 31 additions and 16 deletions

View File

@ -18,6 +18,7 @@
./services/gitea.nix ./services/gitea.nix
./services/minecraft.nix ./services/minecraft.nix
# ./services/soulseek.nix # ./services/soulseek.nix
./services/wg.nix
./services/qbittorrent.nix ./services/qbittorrent.nix
./services/bitmagnet.nix ./services/bitmagnet.nix
]; ];

View File

@ -1,5 +1,23 @@
{ pkgs, service_configs, ... }: { pkgs, service_configs, ... }:
{ {
vpnNamespaces.wg = {
portMappings = [
{
from = service_configs.ports.bitmagnet;
to = service_configs.ports.bitmagnet;
}
];
openVPNPorts = [
{
# TODO! make an issue about this variable
port = service_configs.ports.bitmagnet;
protocol = "both";
}
];
};
services.bitmagnet = { services.bitmagnet = {
enable = true; enable = true;
@ -17,5 +35,4 @@
enable = true; enable = true;
vpnNamespace = "wg"; vpnNamespace = "wg";
}; };
} }

View File

@ -8,21 +8,11 @@
{ {
# network namespace that is proxied through mullvad # network namespace that is proxied through mullvad
vpnNamespaces.wg = { vpnNamespaces.wg = {
enable = true;
wireguardConfigFile = ../secrets/wg0.conf;
accessibleFrom = [
"192.168.0.0/24"
];
portMappings = [ portMappings = [
{ {
from = config.services.qbittorrent.webuiPort; from = config.services.qbittorrent.webuiPort;
to = config.services.qbittorrent.webuiPort; to = config.services.qbittorrent.webuiPort;
} }
{
from = service_configs.ports.bitmagnet;
to = service_configs.ports.bitmagnet;
}
]; ];
openVPNPorts = [ openVPNPorts = [
@ -30,11 +20,6 @@
port = config.services.qbittorrent.webuiPort; port = config.services.qbittorrent.webuiPort;
protocol = "both"; protocol = "both";
} }
{
# TODO! make an issue about this variable
port = service_configs.ports.bitmagnet;
protocol = "both";
}
]; ];
}; };

12
services/wg.nix Normal file
View File

@ -0,0 +1,12 @@
{ pkgs, service_configs, ... }:
{
# network namespace that is proxied through mullvad
vpnNamespaces.wg = {
enable = true;
wireguardConfigFile = ../secrets/wg0.conf;
accessibleFrom = [
"192.168.0.0/24"
];
};
}