diff --git a/configuration.nix b/configuration.nix index e4be65a..3874764 100644 --- a/configuration.nix +++ b/configuration.nix @@ -18,6 +18,7 @@ ./services/gitea.nix ./services/minecraft.nix # ./services/soulseek.nix + ./services/wg.nix ./services/qbittorrent.nix ./services/bitmagnet.nix ]; diff --git a/services/bitmagnet.nix b/services/bitmagnet.nix index d7de760..7a7cd53 100644 --- a/services/bitmagnet.nix +++ b/services/bitmagnet.nix @@ -1,5 +1,23 @@ { 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 = { enable = true; @@ -17,5 +35,4 @@ enable = true; vpnNamespace = "wg"; }; - } diff --git a/services/qbittorrent.nix b/services/qbittorrent.nix index ac33cc3..d95c3a2 100644 --- a/services/qbittorrent.nix +++ b/services/qbittorrent.nix @@ -8,21 +8,11 @@ { # network namespace that is proxied through mullvad vpnNamespaces.wg = { - enable = true; - wireguardConfigFile = ../secrets/wg0.conf; - accessibleFrom = [ - "192.168.0.0/24" - ]; portMappings = [ { from = config.services.qbittorrent.webuiPort; to = config.services.qbittorrent.webuiPort; } - { - from = service_configs.ports.bitmagnet; - to = service_configs.ports.bitmagnet; - - } ]; openVPNPorts = [ @@ -30,11 +20,6 @@ port = config.services.qbittorrent.webuiPort; protocol = "both"; } - { - # TODO! make an issue about this variable - port = service_configs.ports.bitmagnet; - protocol = "both"; - } ]; }; diff --git a/services/wg.nix b/services/wg.nix new file mode 100644 index 0000000..258a58e --- /dev/null +++ b/services/wg.nix @@ -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" + ]; + }; +}