Samba

From NixOS Wiki
Revision as of 12:14, 1 July 2017 by imported>Fadenb (Created page with "== Motivation == This guide will help you on how to use samba on nixos. == excerpt of /etc/nixos/configuration.nix == <pre> services.samba.enable = true; services.samb...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Motivation

This guide will help you on how to use samba on nixos.

excerpt of /etc/nixos/configuration.nix

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

If your firewall is enabled, or if you consider enabling it:

  networking.firewall.enable = true;
  networking.firewall.allowPing = true;
  networking.firewall.allowedTCPPorts = [ 445 139 ];
  networking.firewall.allowedUDPPorts = [ 137 138 ];

samba should startup afterwards

stopping/restarting the services

 stop samba
 start samba
 restart samba

links