nixos-config/services/media.nix

23 lines
328 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
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
}