feat: Enhance NAS Samba share configuration with user allowance

This commit is contained in:
pazpi 2024-11-29 16:10:38 +01:00
parent c9e0431acf
commit 87cd7000a1
2 changed files with 14 additions and 2 deletions

View file

@ -11,13 +11,22 @@ in
{
options.my.networking.nas-samba-share = {
enable = mkEnableOption "Enable Samba connection with NAS";
allowUsers = mkOption {
type = types.listOf types.str;
default = [ ];
description = ''
List of users that are allowed to connect to the NAS.
'';
};
};
config = mkIf cfg.enable {
users.groups."lxc_shares" = {
gid = 10000;
members = [ config.users.users.pazpi.name ];
members = [ config.users.users.pazpi.name ] ++ cfg.allowUsers;
};
};