From 55a59f4006342c0073bfe530b97b4d35450fe3b8 Mon Sep 17 00:00:00 2001 From: Andre Date: Thu, 3 Oct 2024 20:31:51 -0400 Subject: [PATCH] Services: Allow multiple countries for QBT's VPN --- hosts/Hevana/default.nix | 4 ++++ modules/services/qbittorrent.nix | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hosts/Hevana/default.nix b/hosts/Hevana/default.nix index 2a2f1e8..8a53cda 100644 --- a/hosts/Hevana/default.nix +++ b/hosts/Hevana/default.nix @@ -231,6 +231,10 @@ in vpn = { enable = true; privateKey = config.secrets.services.protonvpn.privateKey; + countries = [ + "Norway" + "Netherlands" + ]; }; }; ssh = { diff --git a/modules/services/qbittorrent.nix b/modules/services/qbittorrent.nix index 786ae96..8f226ad 100644 --- a/modules/services/qbittorrent.nix +++ b/modules/services/qbittorrent.nix @@ -46,6 +46,11 @@ in type = lib.types.str; description = "Wireguard private key."; }; + countries = lib.mkOption { + type = lib.types.listOf lib.types.str; + description = "List of countries to base the VPN out of."; + default = [ "Netherlands" ]; + }; }; }; }; @@ -97,7 +102,7 @@ in VPN_SERVICE_PROVIDER = "protonvpn"; VPN_TYPE = "wireguard"; WIREGUARD_PRIVATE_KEY = config.secrets.services.protonvpn.privateKey; - SERVER_COUNTRIES = "Netherlands"; + SERVER_COUNTRIES = (lib.strings.concatStringsSep "," cfg.vpn.countries); TZ = "America/New_York"; }; ports = [ "${cfg.port}:${cfg.port}" ];