2021-01-31 22:31:04 +01:00
|
|
|
# Abstracting away the need for a common 'media' group
|
|
|
|
|
|
|
|
{ config, lib, ... }:
|
|
|
|
let
|
2021-02-18 14:25:40 +01:00
|
|
|
mediaServices = with config.my.services; [
|
2021-02-18 15:02:43 +01:00
|
|
|
calibre-web
|
2021-02-18 14:25:40 +01:00
|
|
|
jellyfin
|
|
|
|
pirate
|
|
|
|
sabnzbd
|
|
|
|
transmission
|
|
|
|
];
|
|
|
|
needed = builtins.any (service: service.enable) mediaServices;
|
2021-01-31 22:31:04 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
config.users.groups.media = lib.mkIf needed { };
|
|
|
|
}
|