init
This commit is contained in:
39
modules/nixos/samba.nix
Normal file
39
modules/nixos/samba.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{ username, pkgs, ... }:
|
||||
{
|
||||
|
||||
services.samba-wsdd.enable = true; # make shares visible for windows 10 clients
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
5357 # wsdd
|
||||
];
|
||||
networking.firewall.allowedUDPPorts = [
|
||||
3702 # wsdd
|
||||
];
|
||||
services.samba = {
|
||||
enable = true;
|
||||
settings = {
|
||||
global = {
|
||||
"workgroup" = "WORKGROUP";
|
||||
"server string" = "smbnix";
|
||||
"netbios name" = "smbnix";
|
||||
"security" = "user";
|
||||
#use sendfile = "yes"
|
||||
#max protocol = "smb2"
|
||||
# note: localhost is the ipv6 localhost ::1
|
||||
"hosts allow" = "10.7.43. 127.0.0.1 localhost";
|
||||
"hosts deny" = "0.0.0.0/0";
|
||||
"guest account" = "nobody";
|
||||
"map to guest" = "bad user";
|
||||
};
|
||||
tmp = {
|
||||
path = "/home/${username}/tmp";
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
"guest ok" = "yes";
|
||||
"create mask" = "0644";
|
||||
"directory mask" = "0755";
|
||||
"force user" = "${username}";
|
||||
"force group" = "users";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user