nixos-config/services/media.nix

22 lines
312 B
Nix
Raw Normal View History

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
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
}