Set up Samba share

This commit is contained in:
coolneng 2021-03-19 11:12:57 +01:00
parent d3c201d200
commit 14f9130df8
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 15 additions and 11 deletions

View File

@ -1,30 +1,34 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
# Samba configuration
environment.systemPackages = with pkgs; [ samba ];
services.samba = { services.samba = {
enable = true; enable = true;
securityType = "share";
nsswins = true; nsswins = true;
syncPasswordsByPam = true;
extraConfig = '' extraConfig = ''
workgroup = WORKGROUP workgroup = WORKGROUP
server string = samba server string = unit
netbios name = samba netbios name = unit
security = ${config.services.samba.securityType}
hosts allow = 10.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody guest account = nobody
map to guest = bad user map to guest = bad user
load printers=no
smb encrypt = required
server min protocol = SMB2_10
client min protocol = SMB2
client max protocol = SMB3
ntlm auth = yes
''; '';
shares.public = { shares.public = {
# FIXME Change path accordingly path = "/vault/samba/CSD";
sharepath = "/vault/samba";
browseable = "yes"; browseable = "yes";
"read only" = "no"; "read only" = "no";
"guest ok" = "yes";
"create mask" = "0644"; "create mask" = "0644";
"directory mask" = "0755"; "directory mask" = "0755";
"force user" = "nobody"; "force user" = "coace";
"force group" = "nobody"; "force group" = "users";
}; };
}; };
} }