add samba
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
./modules/github-runner.nix
|
||||
./modules/nextcloud.nix
|
||||
./modules/acme.nix
|
||||
./modules/samba.nix
|
||||
#./modules/dyndns.nix i think ddclient is deprecated
|
||||
#./modules/home-assistant.nix idk dont like this
|
||||
agenix.nixosModules.default
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
# Replace the email here!
|
||||
email = "7265381+Kropatz@users.noreply.github.com";
|
||||
defaults.email = "7265381+Kropatz@users.noreply.github.com";
|
||||
};
|
||||
}
|
||||
46
test-server/modules/samba.nix
Normal file
46
test-server/modules/samba.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
services.samba-wsdd.enable = true; # make shares visible for windows 10 clients
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
5357 # wsdd
|
||||
];
|
||||
networking.firewall.allowedUDPPorts = [
|
||||
3702 # wsdd
|
||||
];
|
||||
services.samba.openFirewall = true;
|
||||
services.samba = {
|
||||
enable = true;
|
||||
securityType = "user";
|
||||
invalidUsers = [
|
||||
"root"
|
||||
];
|
||||
extraConfig = ''
|
||||
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 = 192.168.0. 192.168.174.1 127.0.0.1 localhost
|
||||
hosts deny = 0.0.0.0/0
|
||||
guest account = nobody
|
||||
map to guest = bad user
|
||||
'';
|
||||
shares = {
|
||||
homes = {
|
||||
browseable = "no";
|
||||
writable = "yes";
|
||||
};
|
||||
private = {
|
||||
path = "/mnt/Shares/Private";
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
"guest ok" = "no";
|
||||
"create mask" = "0644";
|
||||
"directory mask" = "0755";
|
||||
"force user" = "username";
|
||||
"force group" = "groupname";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user