create 'lib.vpnNamespaceOpenPort'
This commit is contained in:
parent
c272eb9d5b
commit
306e320a3a
21
lib.nix
21
lib.nix
@ -54,5 +54,26 @@ inputs.nixpkgs.lib.extend (
|
|||||||
"-march=znver3"
|
"-march=znver3"
|
||||||
"-mtune=znver3"
|
"-mtune=znver3"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
vpnNamespaceOpenPort =
|
||||||
|
port:
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
vpnNamespaces.wg = {
|
||||||
|
portMappings = [
|
||||||
|
{
|
||||||
|
from = port;
|
||||||
|
to = port;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
openVPNPorts = [
|
||||||
|
{
|
||||||
|
port = port;
|
||||||
|
protocol = "both";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@ -2,25 +2,14 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
service_configs,
|
service_configs,
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
vpnNamespaces.wg = {
|
imports = [
|
||||||
portMappings = [
|
(lib.vpnNamespaceOpenPort service_configs.ports.bitmagnet)
|
||||||
{
|
|
||||||
from = service_configs.ports.bitmagnet;
|
|
||||||
to = service_configs.ports.bitmagnet;
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
openVPNPorts = [
|
|
||||||
{
|
|
||||||
port = service_configs.ports.bitmagnet;
|
|
||||||
protocol = "both";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.bitmagnet = {
|
services.bitmagnet = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|||||||
@ -13,25 +13,9 @@
|
|||||||
config.services.qbittorrent.serverConfig.Preferences.Downloads.TempPath
|
config.services.qbittorrent.serverConfig.Preferences.Downloads.TempPath
|
||||||
"${config.services.qbittorrent.profileDir}/qBittorrent"
|
"${config.services.qbittorrent.profileDir}/qBittorrent"
|
||||||
])
|
])
|
||||||
|
(lib.vpnNamespaceOpenPort config.services.qbittorrent.webuiPort)
|
||||||
];
|
];
|
||||||
|
|
||||||
# network namespace that is proxied through mullvad
|
|
||||||
vpnNamespaces.wg = {
|
|
||||||
portMappings = [
|
|
||||||
{
|
|
||||||
from = config.services.qbittorrent.webuiPort;
|
|
||||||
to = config.services.qbittorrent.webuiPort;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
openVPNPorts = [
|
|
||||||
{
|
|
||||||
port = config.services.qbittorrent.webuiPort;
|
|
||||||
protocol = "both";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.qbittorrent = {
|
services.qbittorrent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
webuiPort = service_configs.ports.torrent;
|
webuiPort = service_configs.ports.torrent;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user