feat: create dedicated samba user

Also set samba share permissions to 0775 to allow users with `media`
group to create files.
This commit is contained in:
Felix Schröter 2022-07-13 23:58:39 +02:00
parent feb5e19694
commit 5fa9c0c87b
Signed by: felschr
GPG key ID: 671E39E6744C807D
2 changed files with 12 additions and 3 deletions

View file

@ -15,7 +15,10 @@
"x-systemd.mount-timeout=5s" "x-systemd.mount-timeout=5s"
"uid=1000" "uid=1000"
"gid=100"
"credentials=${config.age.secrets.samba.path}" "credentials=${config.age.secrets.samba.path}"
"nobrl"
]; ];
}; };
} }

View file

@ -4,6 +4,11 @@
# Use `smbpasswd -a <user>` to set passwords # Use `smbpasswd -a <user>` to set passwords
# age.secrets.samba.file = ../../secrets/samba.age; # age.secrets.samba.file = ../../secrets/samba.age;
users.users.samba = {
isSystemUser = true;
group = "media";
};
services.samba = { services.samba = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
@ -19,9 +24,10 @@
public = "no"; public = "no";
browseable = "yes"; browseable = "yes";
writeable = "yes"; writeable = "yes";
"create mask" = "0644"; "valid users" = "felschr";
"directory mask" = "0755"; "create mask" = "0664";
"force user" = "felschr"; "directory mask" = "0775";
"force user" = "samba";
"force group" = "media"; "force group" = "media";
}; };
}; };