Samba: Difference between revisions

imported>Mic92
No edit summary
imported>Sjau
changeing server stuff.... adding seperate shares
Line 32: Line 32:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
services.samba.enable = true;
services.samba = {
services.samba.securityType = "share";
  enable = true;
services.samba.extraConfig = ''
  securityType = "share";
  workgroup = WORKGROUP
  extraConfig = ''
  server string = smbnix
    workgroup = WORKGROUP
  netbios name = smbnix
    server string = smbnix
  security = share  
    netbios name = smbnix
  #use sendfile = yes
    security = share  
  #max protocol = smb2
    #use sendfile = yes
 
    #max protocol = smb2
   [rw-files]
    hosts allow = 192.168.0  localhost
     comment = Temporary rw files
    hosts deny = 0.0.0.0/0
    path = /storage
    guest account = nobody
    read only = no
    map to guest = bad user
    writable = yes
   '';
     public = yes
  shares = {
'';
     public = {
      path = "/mnt/Shares/Public";
      browseable = "yes";
      "read only" = "no";
      "guest ok" = "yes";
      "create mask" = "0644";
      "directory mask" = "0755";
      "force user" = "username";
      "force group" = "groupname";
    };
     private = {
      path = "/mnt/Shares/Private";
      browseable = "yes";
      "read only" = "no";
      "guest ok" = "no";
      "create mask" = "0644";
      "directory mask" = "0755";
      "force user" = "username";
      "force group" = "groupname";
    };
  };
};
</syntaxhighlight>
</syntaxhighlight>