From 4c12928356a8000640be87991382f3355fe791e2 Mon Sep 17 00:00:00 2001 From: NeoTheFox Date: Tue, 6 Jul 2021 01:43:01 +0300 Subject: [PATCH] improve PS2 handling --- samba.nix | 61 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/samba.nix b/samba.nix index ba2230d..bfbc7a0 100644 --- a/samba.nix +++ b/samba.nix @@ -2,34 +2,63 @@ { +users.users.samba = { + isSystemUser = true; + description = "Samba User"; + extraGroups = [ "samba" ]; +}; + services.samba = { enable = true; securityType = "user"; extraConfig = '' - workgroup = WORKGROUP - server string = smbnix - netbios name = smbnix - security = user - #use sendfile = yes - #max protocol = smb2 - min protocol = NT1 - hosts allow = 192.168.0 localhost - hosts deny = 0.0.0.0/0 - guest account = nobody - map to guest = bad user + workgroup = WORKGROUP + server string = PS2 Samba Server + server role = standalone server + max log size = 0 + + # Disable printers. + load printers = no + printing = bsd + printcap name = /etc/printcap + printcap cache time = 0 + disable spoolss = yes + + pam password change = yes + map to guest = bad user + usershare allow guests = yes + create mask = 0664 + force create mode = 0664 + directory mask = 0775 + force directory mode = 0775 + force user = + force group = users + + # =========================== + # PlayStations 2 OPL settings + # =========================== + # Lower the minimum protocol to NT1 (a SMB1 dialect), this is required since + # Samba 4.11 changed the default and deprecated SMB1. + # See https://github.com/ifcaro/Open-PS2-Loader/issues/86 and + # https://github.com/ps2dev/ps2sdk/issues/72 for future SMB2 support. + server min protocol = NT1 + server signing = disabled + smb encrypt = disabled + socket options = TCP_NODELAY TCP_KEEPIDLE=20 IPTOS_LOWDELAY SO_KEEPALIVE + + # Disable keepalive to avoid hanging onto locks. Should not be needed + # due to SO_KEEPALIVE and helps with FMV audio stutter. + keepalive = 0 ''; shares = { - public = { + PS2SMB = { + "comment" = "PlaStation 2"; path = "/mnt/ps2"; browseable = "yes"; "read only" = "no"; "guest ok" = "yes"; "public" = "yes"; "available" = "yes"; - "create mask" = "0644"; - "directory mask" = "0755"; - "force user" = "username"; - "force group" = "groupname"; }; }; };