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" "/var/db/sudo"
"/etc/zfs" "/etc/zfs"
"/var/lib/samba"
]; ];
files = [ files = [
"/etc/machine-id" "/etc/machine-id"

View File

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