34 lines
1.2 KiB
Nix
34 lines
1.2 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
# Windows File Sharing (Samba)
|
|
# Lets you share folders with other computers on your local network
|
|
# — including Windows and Linux systems.
|
|
#
|
|
# Only needed if you plan to share files across your network.
|
|
# Safe to disable if you don't use network file sharing.
|
|
# From https://codeberg.org/Linux-Is-Best/NixOS_Configuration/
|
|
|
|
services.samba = {
|
|
enable = true; # Enable Samba.
|
|
smbd.enable = true; # SMB daemon (core file sharing service).
|
|
nmbd.enable = true; # NetBIOS name resolution (for older Windows clients).
|
|
usershares.enable = true; # Allows users to share folders like ~/Public.
|
|
nsswins = true; # Enable WINS for name resolution (compatible with Windows).
|
|
|
|
settings = {
|
|
global = {
|
|
workgroup = "WORKGROUP"; # Standard Windows workgroup name.
|
|
security = "user"; # Require user authentication for shares.
|
|
"invalid users" = [ "root" ]; # Forbid root from using Samba.
|
|
};
|
|
};
|
|
};
|
|
|
|
# WS-Discovery (Windows Network Visibility in File Explorer)
|
|
# Makes your system show up in the “Network” tab on Windows 10+.
|
|
services.samba-wsdd = {
|
|
enable = true;
|
|
};
|
|
|
|
}
|