fix: only enable media services when needed
Some checks failed
Test action / kaas (push) Failing after 1s

This commit is contained in:
Chris Kruining 2025-12-18 15:11:04 +01:00
parent 1ee8fa3407
commit b2a0a2a26d
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2

View file

@ -11,6 +11,7 @@
inherit (lib) mkIf mkEnableOption mkOption types; inherit (lib) mkIf mkEnableOption mkOption types;
cfg = config.${namespace}.services.media.servarr; cfg = config.${namespace}.services.media.servarr;
anyEnabled = cfg |> lib.attrNames |> lib.length |> (l: l > 0);
in { in {
options.${namespace}.services.media = { options.${namespace}.services.media = {
servarr = mkOption { servarr = mkOption {
@ -33,7 +34,7 @@ in {
}; };
}; };
config = { config = mkIf anyEnabled {
services = services =
cfg cfg
|> lib.mapAttrsToList (service: { |> lib.mapAttrsToList (service: {
@ -269,6 +270,11 @@ in {
}; };
groups.${service} = {}; groups.${service} = {};
})) }))
|> lib.concat [
{
groups.media = {};
}
]
|> lib.mkMerge; |> lib.mkMerge;
sops = sops =