fix: only enable media services when needed
Some checks failed
Test action / kaas (push) Failing after 1s
Some checks failed
Test action / kaas (push) Failing after 1s
This commit is contained in:
parent
1ee8fa3407
commit
b2a0a2a26d
1 changed files with 7 additions and 1 deletions
|
|
@ -11,6 +11,7 @@
|
|||
inherit (lib) mkIf mkEnableOption mkOption types;
|
||||
|
||||
cfg = config.${namespace}.services.media.servarr;
|
||||
anyEnabled = cfg |> lib.attrNames |> lib.length |> (l: l > 0);
|
||||
in {
|
||||
options.${namespace}.services.media = {
|
||||
servarr = mkOption {
|
||||
|
|
@ -33,7 +34,7 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
config = mkIf anyEnabled {
|
||||
services =
|
||||
cfg
|
||||
|> lib.mapAttrsToList (service: {
|
||||
|
|
@ -269,6 +270,11 @@ in {
|
|||
};
|
||||
groups.${service} = {};
|
||||
}))
|
||||
|> lib.concat [
|
||||
{
|
||||
groups.media = {};
|
||||
}
|
||||
]
|
||||
|> lib.mkMerge;
|
||||
|
||||
sops =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue