wait on qbt service before init
This commit is contained in:
21
module.nix
21
module.nix
@@ -51,6 +51,17 @@ let
|
||||
tvCategory = "tvshows";
|
||||
};
|
||||
};
|
||||
|
||||
serviceName = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
Name of the systemd service for this download client.
|
||||
When set, the init service will depend on (After + Requires) this service,
|
||||
ensuring the download client is running before health checks execute.
|
||||
'';
|
||||
example = "qbittorrent";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -424,6 +435,13 @@ let
|
||||
# Get list of service names that syncedApps depend on
|
||||
getSyncedAppDeps = inst: map (app: "${app.serviceName}.service") inst.syncedApps;
|
||||
|
||||
# Get list of service names that download clients depend on
|
||||
getDownloadClientDeps =
|
||||
inst:
|
||||
lib.concatMap (
|
||||
dc: lib.optional (dc.serviceName != null) "${dc.serviceName}.service"
|
||||
) inst.downloadClients;
|
||||
|
||||
enabledInstances = lib.filterAttrs (_: inst: inst.enable) cfg;
|
||||
|
||||
mkBazarrProviderSection =
|
||||
@@ -525,8 +543,9 @@ in
|
||||
"${inst.serviceName}.service"
|
||||
]
|
||||
++ (getSyncedAppDeps inst)
|
||||
++ (getDownloadClientDeps inst)
|
||||
++ (lib.optional (inst.networkNamespacePath != null) "wg.service");
|
||||
requires = [ "${inst.serviceName}.service" ];
|
||||
requires = [ "${inst.serviceName}.service" ] ++ (getDownloadClientDeps inst);
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
|
||||
Reference in New Issue
Block a user