Samba: Difference between revisions
imported>Fadenb m Syntaxhighlight |
imported>Fadenb m →excerpt of /etc/nixos/configuration.nix: whitespace removal |
||
Line 5: | Line 5: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="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 | |||
''; | |||
</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.allowPing = true; | |||
networking.firewall.allowedTCPPorts = [ 445 139 ]; | |||
networking.firewall.allowedUDPPorts = [ 137 138 ]; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 12:57, 27 August 2017
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
# systemctl stop samba
# systemctl start samba
# systemctl restart samba