add samba

This commit is contained in:
Kopatz
2023-10-26 14:02:48 +02:00
parent fc55d72556
commit 5b0d9c8d5e
3 changed files with 48 additions and 1 deletions

View File

@@ -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

View File

@@ -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";
};
}

View 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";
};
};
};
}