From 14f9130df88a77eea8e5259c6a1c3bd3d37c5997 Mon Sep 17 00:00:00 2001 From: coolneng Date: Fri, 19 Mar 2021 11:12:57 +0100 Subject: [PATCH] Set up Samba share --- modules/datasync.nix | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/modules/datasync.nix b/modules/datasync.nix index 73b10c1..a6ed499 100644 --- a/modules/datasync.nix +++ b/modules/datasync.nix @@ -1,30 +1,34 @@ { config, lib, pkgs, ... }: { + # Samba configuration + environment.systemPackages = with pkgs; [ samba ]; + services.samba = { enable = true; - securityType = "share"; nsswins = true; + syncPasswordsByPam = true; extraConfig = '' workgroup = WORKGROUP - server string = samba - netbios name = samba - security = ${config.services.samba.securityType} - hosts allow = 10.0.1 localhost - hosts deny = 0.0.0.0/0 + server string = unit + netbios name = unit guest account = nobody map to guest = bad user + load printers=no + smb encrypt = required + server min protocol = SMB2_10 + client min protocol = SMB2 + client max protocol = SMB3 + ntlm auth = yes ''; shares.public = { - # FIXME Change path accordingly - sharepath = "/vault/samba"; + path = "/vault/samba/CSD"; browseable = "yes"; "read only" = "no"; - "guest ok" = "yes"; "create mask" = "0644"; "directory mask" = "0755"; - "force user" = "nobody"; - "force group" = "nobody"; + "force user" = "coace"; + "force group" = "users"; }; }; }