Compare commits

...

7 Commits

Author SHA1 Message Date
Adrian Gunnar Lauterer b97b8ce576 avahi fix2 2024-04-10 17:21:47 +02:00
Adrian Gunnar Lauterer aa188f5ee7 avahi fix 2024-04-10 17:21:11 +02:00
Adrian Gunnar Lauterer 7a08654e28 smb more 2024-04-10 17:18:31 +02:00
Adrian Gunnar Lauterer 5ef3c78d4b yolo 2024-04-10 17:00:40 +02:00
Adrian Gunnar Lauterer 4483b84cbe plz 2024-04-10 16:55:34 +02:00
Adrian Gunnar Lauterer 0e4a5fb0b6 for real this time smb i hope 2024-04-10 16:46:02 +02:00
Adrian Gunnar Lauterer f7bc5bd7b1 smb perm fix 2024-04-10 16:31:45 +02:00
2 changed files with 48 additions and 19 deletions

View File

@ -124,8 +124,8 @@
services.tailscale.enable = true; services.tailscale.enable = true;
# Open ports in the firewall. # Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 22 80 8090 8096 443 433 6969 1194 ]; networking.firewall.allowedTCPPorts = [ 22 80 8090 8096 443 433 6969 1194 445 139];
networking.firewall.allowedUDPPorts = [ 22 80 8090 8096 443 433 6969 1194 ]; networking.firewall.allowedUDPPorts = [ 22 80 8090 8096 443 433 6969 1194 137 138];
networking.firewall.enable = true; networking.firewall.enable = true;
##storage ##storage

View File

@ -3,20 +3,23 @@
services.samba = { services.samba = {
package = pkgs.samba4Full;
enable = true; enable = true;
securityType = "user"; securityType = "user";
openFirewall = true; openFirewall = true;
extraConfig = '' extraConfig = ''
workgroup = WORKGROUP workgroup = WORKGROUP
server string = smbnix server string = galadriel
netbios name = smbnix netbios name = galadriel
security = user security = user
#use sendfile = yes #use sendfile = yes
#max protocol = smb2 #max protocol = smb2
min protocol = SMB3_00
server smb encrypt = required
# note: localhost is the ipv6 localhost ::1 # note: localhost is the ipv6 localhost ::1
hosts allow = 192.168.0. 127.0.0.1 localhost 100.0.0.0/8 hosts allow = 192.168.1. 127.0.0.1 localhost 100.
hosts deny = 0.0.0.0/0 hosts deny = 0.0.0.0/0
guest account = nobody guest account = guest
map to guest = bad user map to guest = bad user
''; '';
shares = { shares = {
@ -30,24 +33,16 @@ services.samba = {
# "force user" = "username"; # "force user" = "username";
# "force group" = "groupname"; # "force group" = "groupname";
# }; # };
Main = { Backup = {
path = "/Main"; path = "/Main/Backup";
"valid users" = "gunalx"; "valid users" = "gunalx";
"force user" = "gunalx"; "force user" = "gunalx";
"force group" = "gunalx"; "force group" = "gunalx";
public = "no";
browseable = "yes"; browseable = "yes";
writeable = "yes";
"fruit:aapl" = "yes";
"fruit:time machine" = "yes";
"vfs objects" = "catia fruit streams_xattr";
"read only" = "no"; "read only" = "no";
"guest ok" = "no"; "guest ok" = "yes";
"create mask" = "0644"; "create mask" = "0777";
"directory mask" = "0755"; "directory mask" = "0777";
}; };
}; };
}; };
@ -61,4 +56,38 @@ services.samba-wsdd = {
networking.firewall.allowPing = true; networking.firewall.allowPing = true;
#services.avahi.openfirewall = true;
services.avahi = {
enable = true;
nssmdns = true;
#nssmdns4 = true;
publish = {
enable = true;
addresses = true;
domain = true;
hinfo = true;
userServices = true;
workstation = true;
};
extraServiceFiles = {
smb = ''
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_smb._tcp</type>
<port>445</port>
</service>
</service-group>
'';
};
};
} }