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