2022-04-10 11:54:58 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(lib)
|
2022-01-11 16:08:21 +01:00
|
|
|
mkIf
|
2022-04-10 11:54:58 +02:00
|
|
|
;
|
2022-01-11 16:08:21 +01:00
|
|
|
|
|
|
|
mediaServices = builtins.attrValues {
|
2022-04-10 11:54:58 +02:00
|
|
|
inherit
|
|
|
|
(config.my.services)
|
2022-01-11 16:08:21 +01:00
|
|
|
jellyfin
|
2022-11-07 16:33:39 +01:00
|
|
|
nextcloud
|
2022-01-11 16:08:21 +01:00
|
|
|
transmission
|
2022-04-10 11:54:58 +02:00
|
|
|
;
|
2022-01-11 16:08:21 +01:00
|
|
|
};
|
2021-02-19 21:21:35 +01:00
|
|
|
needed = builtins.any (service: service.enable) mediaServices;
|
2022-04-10 11:54:58 +02:00
|
|
|
in {
|
|
|
|
config.users.groups.media = mkIf needed {};
|
2021-02-19 21:21:35 +01:00
|
|
|
}
|