nixos-config/modules/system/services/server/fileserver/samba/default.nix
2025-01-01 16:54:27 -05:00

27 lines
607 B
Nix

{ config, lib, ... }:
{
services = lib.mkIf config.system.server.enable {
samba = {
enable = true;
openFirewall = true;
settings = {
global = {
"workgroup" = "WORKGROUP";
"server string" = "NixSMB";
"security" = "user";
"hosts allow" = "${config.ips.localSpan}. 127.0.0.1 localhost";
"hosts deny" = "0.0.0.0/0";
"guest account" = "nobody";
"map to guest" = "bad user";
};
};
};
# Advertise to Windows
samba-wsdd = {
enable = true;
openFirewall = true;
};
};
}