2024-12-05 21:58:18 +00:00
|
|
|
{
|
2025-01-20 22:35:40 -05:00
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2024-12-05 21:58:18 +00:00
|
|
|
|
2025-01-20 22:35:40 -05:00
|
|
|
let
|
2025-02-15 20:26:14 -05:00
|
|
|
inherit (config.nmasur.settings) username;
|
2025-01-20 22:35:40 -05:00
|
|
|
cfg = config.nmasur.profiles.shared-media;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options.nmasur.profiles.shared-media.enable = lib.mkEnableOption "shared media groups";
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2024-12-05 21:58:18 +00:00
|
|
|
|
|
|
|
# Create a shared group for many services
|
|
|
|
users.groups.shared = { };
|
|
|
|
|
|
|
|
# Give the human user access to the shared group
|
2025-02-15 20:26:14 -05:00
|
|
|
users.users.${username}.extraGroups = [ config.users.groups.shared.name ];
|
2024-12-05 21:58:18 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|