services: media: refactor logic
This makes it more DRY.
This commit is contained in:
parent
b3aa8d94cb
commit
51491b99a9
|
@ -2,8 +2,13 @@
|
||||||
|
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
needed = with config.my.services;
|
mediaServices = with config.my.services; [
|
||||||
jellyfin.enable || pirate.enable || sabnzbd.enable || transmission.enable;
|
jellyfin
|
||||||
|
pirate
|
||||||
|
sabnzbd
|
||||||
|
transmission
|
||||||
|
];
|
||||||
|
needed = builtins.any (service: service.enable) mediaServices;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config.users.groups.media = lib.mkIf needed { };
|
config.users.groups.media = lib.mkIf needed { };
|
||||||
|
|
Loading…
Reference in a new issue