Samba: Difference between revisions

imported>Fadenb
m Syntaxhighlight
imported>Fadenb
Line 5: Line 5:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
  services.samba.enable = true;
services.samba.enable = true;
  services.samba.securityType = "share";
services.samba.securityType = "share";
  services.samba.extraConfig = ''
services.samba.extraConfig = ''
    workgroup = WORKGROUP
  workgroup = WORKGROUP
    server string = smbnix
  server string = smbnix
    netbios name = smbnix
  netbios name = smbnix
    security = share  
  security = share  
    #use sendfile = yes
  #use sendfile = yes
    #max protocol = smb2
  #max protocol = smb2
    
 
    [rw-files]
   [rw-files]
      comment = Temporary rw files  
    comment = Temporary rw files  
      path = /storage
    path = /storage
      read only = no
    read only = no
      writable = yes
    writable = yes
      public = yes
    public = yes
  '';
'';
</syntaxhighlight>
</syntaxhighlight>


If your firewall is enabled, or if you consider enabling it:
If your firewall is enabled, or if you consider enabling it:
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
  networking.firewall.enable = true;
networking.firewall.enable = true;
  networking.firewall.allowPing = true;
networking.firewall.allowPing = true;
  networking.firewall.allowedTCPPorts = [ 445 139 ];
networking.firewall.allowedTCPPorts = [ 445 139 ];
  networking.firewall.allowedUDPPorts = [ 137 138 ];
networking.firewall.allowedUDPPorts = [ 137 138 ];
</syntaxhighlight>
</syntaxhighlight>