nixconfig/modules/smb.nix
death916 fa23544a73 smb
2026-01-17 07:20:18 -08:00

30 lines
799 B
Nix

{ config, pkgs, ... }:
{
services.samba = {
enable = true;
openFirewall = true;
settings = {
Media = {
browseable = "yes";
"read only" = "no";
"guest ok" = "no"; # Disables guest access, requires a user login
# This is the key: any new file or directory created through the share
# will be assigned to the 'media_services' group.
"force group" = "media_services";
# Set permissions for new files/dirs to allow group write access.
"create mask" = "0660"; # File permissions: rw-rw----
"directory mask" = "0770"; # Directory permissions: rwxrwx---
};
};
};
# Enable network discovery service for clients.
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
}