nixcfg/systems/x86_64-linux/sgx/fileserver.nix
Harald Hoyer d5f4c3035e feat(sgx): update Samba configuration for protocol and macOS
- Set minimum protocol to SMB2 and enabled extended attribute (EA) support in Samba settings.
- Added `fruit:nfs_aces` and `fruit:wipe_intentionally_left_blank_rfork` options for improved macOS compatibility.
2025-07-30 14:16:48 +02:00

147 lines
4.1 KiB
Nix

{ ...
}:
{
systemd.services.netatalk.requires = [ "mnt-backup.mount" "mnt-raid.mount" ];
systemd.services.netatalk.after = [ "mnt-backup.mount" "mnt-raid.mount" ];
services.netatalk = {
enable = false;
settings = {
Homes = {
"basedir regex" = "/home";
path = "Public";
};
time-machine = {
path = "/mnt/backup/tm_share";
"valid users" = "harald";
"time machine" = true;
};
Qmultimedia = {
path = "/mnt/raid/Qmultimedia";
};
};
};
services.avahi = {
enable = false;
nssmdns4 = true;
nssmdns6 = true;
ipv6 = true;
ipv4 = true;
publish = {
enable = true;
userServices = true;
};
};
systemd.services.samba.requires = [ "mnt-raid.mount" ];
systemd.services.samba.after = [ "mnt-raid.mount" ];
services.samba = {
enable = true;
openFirewall = true;
settings = {
global = {
"security" = "user";
"read raw" = "Yes";
"write raw" = "Yes";
"socket options" = "TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072";
"min receivefile size" = 16384;
"use sendfile" = true;
"aio read size" = 16384;
"aio write size" = 16384;
"workgroup" = "WORKGROUP";
"server string" = "sgx";
"netbios name" = "sgx";
"min protocol" = "SMB2";
"ea support" = "yes";
#"max protocol" = "smb2";
"hosts allow" = "192.168.178. 127.0.0.1 localhost 2003::/16 ::1";
"hosts deny" = "ALL";
"guest account" = "nobody";
"map to guest" = "bad user";
# macOS compat options
"wide links" = "yes";
"unix extensions" = "no";
"vfs object" = "acl_xattr catia fruit streams_xattr";
"fruit:nfc_aces" = "no";
"fruit:aapl" = "yes";
"fruit:model" = "MacSamba";
"fruit:posix_rename" = "yes";
"fruit:metadata" = "stream";
"fruit:delete_empty_adfiles" = "yes";
"fruit:veto_appledouble" = "no";
"fruit:nfs_aces" = "no";
"fruit:wipe_intentionally_left_blank_rfork" = "yes";
"spotlight" = "yes";
};
TimeMachineBackup = {
path = "/mnt/backup/tm_share";
"browseable" = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "harald";
"force group" = "users";
"available" = "yes";
"writable" = "yes";
"valid users" = "harald";
"vfs objects" = "catia fruit streams_xattr";
"fruit:time machine" = "yes";
};
Qmultimedia = {
path = "/mnt/raid/Qmultimedia";
browseable = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "harald";
"force group" = "users";
};
};
};
systemd.services.syncthing.requires = [ "mnt-raid.mount" ];
systemd.services.syncthing.after = [ "mnt-raid.mount" ];
services.syncthing = {
enable = true;
user = "harald";
dataDir = "/mnt/raid/Qmultimedia/syncthing"; # Default folder for new synced folders
configDir = "/mnt/raid/Qmultimedia/syncthing/.config/syncthing"; # Folder for Syncthing's settings and keys
guiAddress = "127.0.0.1:8384";
settings.gui.insecureSkipHostcheck = true;
devices = {
"sgx" = {
id = "2AAVSVQ-PK66I2B-2B4KWAU-TF674DG-IXNEKLF-CIWK7HG-7MUC7OW-DQQNAQM";
};
"S25" = {
id = "7Q7XQXG-VF7QM6Y-HJST4V2-RWOPB3M-GHXQDLL-SRRN3IL-3PHKNOZ-D2IFIQV";
};
"m4" = {
id = "WLIPM6R-RHVUP3S-7DVQJTD-M7NAMCH-ZFEAFI4-HOVXOBN-Q7RTQNG-FMU36QC";
};
"x1" = {
id = "ZXRDFYU-W22PYCZ-7QJJCVN-GGHP3TS-KSY56B4-75OLQRN-UR2A4ZU-7BQBQQZ";
};
};
folders = {
"qibxq-03l4j" = {
path = "~/logseq";
devices = [
"sgx"
"S25"
"x1"
"m4"
];
};
"sm-s931b_hjcb-Bilder" = {
path = "/mnt/raid/Qmultimedia/S25-Kamera";
devices = [
"sgx"
"S25"
];
};
};
};
}