refactor: modify qbittorrent to use enable and port from bundles.common.networking

This commit is contained in:
Ceferino Patino 2026-05-28 20:13:24 -05:00
commit 3122e25803
Signed by: c4patino
SSH key fingerprint: SHA256:9fQ9TsujGrdNNi76mnsu63v7dS5JOmHRZEqBOl49OR8
3 changed files with 12 additions and 12 deletions

View file

@ -60,6 +60,9 @@ in {
prowlarr = {
port = 9696;
};
qbittorrent = {
port = 9000;
};
miasma = {
port = 9999;
internal = true;

View file

@ -4,18 +4,17 @@
namespace,
...
}: let
inherit (lib) mkEnableOption mkIf;
inherit (lib.${namespace}) getAttrByNamespace mkOptionsWithNamespace;
base = "${namespace}.services.apps.qbittorrent";
cfg = getAttrByNamespace config base;
inherit (lib) mkIf;
inherit (lib.${namespace}) getAttrByNamespace hostHasService getServicePort flattenHostServices;
inherit (config.networking) hostName;
port = 9000;
networkCfg = getAttrByNamespace config "${namespace}.services.networking";
networkServices = flattenHostServices networkCfg.network-services;
isEnabled = hostHasService networkCfg.network-services hostName "qbittorrent";
port = getServicePort networkServices "qbittorrent" 9000;
in {
options = mkOptionsWithNamespace base {
enable = mkEnableOption "qbittorrent";
};
config = mkIf cfg.enable {
config = mkIf isEnabled {
services.qbittorrent = {
enable = true;
openFirewall = true;

View file

@ -38,8 +38,6 @@ in {
services = {
apps = {
rustypaste.client = enabled;
qbittorrent = enabled;
};
ci = {