Fix Samba permissions

This commit is contained in:
minish 2024-12-14 03:54:01 -05:00
parent 8ec00d6c61
commit 7599dcac9c
Signed by: min
SSH Key Fingerprint: SHA256:NFjjdbkd6u7aoMlcrDCVvz6o2UBtlAuPm8IQ2vhZ3Fg
2 changed files with 18 additions and 9 deletions

View File

@ -12,6 +12,7 @@
"/var/db/sudo"
"/etc/zfs"
"/var/lib/samba"
];
files = [
"/etc/machine-id"

View File

@ -1,12 +1,20 @@
{...}: {
users = {
users.min = {
isSystemUser = true;
group = "samba";
users = let
shareUser = {
isSystemUser = true;
group = "share";
};
in {
min = shareUser;
};
groups."samba" = {};
groups."share" = {};
};
systemd.tmpfiles.rules = [
"d /terra/terrarium 0775 root share - -"
];
services.samba = {
enable = true;
openFirewall = true;
@ -17,17 +25,17 @@
browseable = yes
smb encrypt = required
valid users = @samba
valid users = @share
'';
shares = {
terra = {
"path" = "/terra";
terrarium = {
"path" = "/terra/terrarium";
"browseable" = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
"create mask" = "0664";
"directory mask" = "0775";
};
};
};