refactor: modify qbittorrent to use enable and port from bundles.common.networking
This commit is contained in:
parent
1bfc220d00
commit
3122e25803
3 changed files with 12 additions and 12 deletions
|
|
@ -60,6 +60,9 @@ in {
|
|||
prowlarr = {
|
||||
port = 9696;
|
||||
};
|
||||
qbittorrent = {
|
||||
port = 9000;
|
||||
};
|
||||
miasma = {
|
||||
port = 9999;
|
||||
internal = true;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -38,8 +38,6 @@ in {
|
|||
services = {
|
||||
apps = {
|
||||
rustypaste.client = enabled;
|
||||
|
||||
qbittorrent = enabled;
|
||||
};
|
||||
|
||||
ci = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue