34 lines
573 B
Nix
34 lines
573 B
Nix
{
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
cfg = config.my.networking.nas-samba-share;
|
|
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 ] ++ cfg.allowUsers;
|
|
};
|
|
|
|
};
|
|
|
|
}
|