Fixed SMB share and enabled encrypt

This commit is contained in:
2026-04-21 22:44:02 +02:00
parent 2aa0257f0d
commit 93252ea70d
2 changed files with 17 additions and 9 deletions

View File

@@ -22,6 +22,7 @@
"map to guest" = "Never"; "map to guest" = "Never";
"invalid users" = [ "root" ]; "invalid users" = [ "root" ];
"socket options" = "TCP_NODELAY IPTOS_LOWDELAY"; "socket options" = "TCP_NODELAY IPTOS_LOWDELAY";
"smb encrypt" = "required";
"use sendfile" = "yes"; "use sendfile" = "yes";
"log level" = "1"; "log level" = "1";
"log file" = "/var/log/samba/log.%m"; "log file" = "/var/log/samba/log.%m";

View File

@@ -69,28 +69,35 @@
(share: { (share: {
name = "/shares/${share}"; name = "/shares/${share}";
value = { value = {
device = "//127.0.0.1/${share}"; device = "//192.168.2.2/${share}";
fsType = "cifs"; fsType = "cifs";
options = [ options = [
"credentials=${config.sops.templates.smb_credentials.path}" "credentials=${config.sops.templates.smb_credentials.path}"
"iocharset=utf8" "iocharset=utf8"
"_netdev" "_netdev"
"auto"
"nofail" "nofail"
"x-systemd.requires=samba-smbd.service" "uid=${toString config.users.users.${primaryUser}.uid}"
"x-systemd.after=samba-smbd.service" "gid=${toString config.users.users.${primaryUser}.group}"
"x-systemd.requires=sops-install-secrets.service" "file_mode=0664"
"x-systemd.after=sops-install-secrets.service" "dir_mode=0775"
"x-systemd.automount"
"x-systemd.idle-timeout=60"
]; ];
}; };
}) })
[ [
"internal" "storage-internal"
"fast" "storage-fast"
"backup" "storage-backup"
] ]
); );
systemd.tmpfiles.rules = [
"d /shares/storage-internal 0775 ${primaryUser} users -"
"d /shares/storage-fast 0775 ${primaryUser} users -"
"d /shares/storage-backup 0775 ${primaryUser} users -"
];
swapDevices = [ ]; swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";