dotfiles/provision/hosts/torus/samba-server.nix

42 lines
1.0 KiB
Nix
Raw Normal View History

2023-10-07 02:11:46 -07:00
{ config, lib, pkgs, ... }:
{
services.samba = {
enable = true;
extraConfig = ''
workgroup = WORKGROUP
server string = smbnix
netbios name = smbnix
security = user
2023-10-08 20:59:04 -07:00
hosts allow = 192.168.3. 192.168.1. 127.0.0.1 localhost
2023-10-07 02:11:46 -07:00
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
'';
shares = {
private = {
"path" = "/engi";
browseable = "yes";
"read only" = "no";
"guest ok" = "no";
"force user" = "tstarr";
"force group" = "users";
};
public = {
"path" = "/engi";
browseable = "yes";
"read only" = "yes";
"guest ok" = "yes";
};
};
};
# Curiously, `services.samba` does not automatically open
# the needed ports in the firewall.
networking.firewall.allowedTCPPorts = [ 445 139 ];
networking.firewall.allowedUDPPorts = [ 137 138 ];
# To make SMB mounting easier on the command line
environment.systemPackages = with pkgs; [ cifs-utils ];
}