Modularizing samba and file mounts

This commit is contained in:
Jordan Ashurst
2026-09-17 07:53:51 -07:00
parent 06b15ab926
commit 7c91f94290
3 changed files with 131 additions and 124 deletions
+72
View File
@@ -0,0 +1,72 @@
{pkgs, ...}: {
services.samba = {
enable = true;
openFirewall = true;
settings = {
global = {
"security" = "user";
"workgroup" = "WORKGROUP";
"server string" = "smbnix";
"netbios name" = "smbnix";
#"use sendfile" = "yes";
#"max protocol" = "smb2";
# note: localhost is the ipv6 localhost ::1
"hosts allow" = "192.168.1.1/24 127.0.0.1 localhost";
"guest account" = "nobody";
"map to guest" = "bad user";
};
"games" = {
"path" = "/mnt/games";
"browseable" = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
};
"media" = {
"path" = "/mnt/media";
"browseable" = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
};
"photos" = {
"path" = "/mnt/photo";
"browseable" = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
};
"winhdd" = {
"path" = "/mnt/winhdd";
"browseable" = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
};
"winback" = {
"path" = "/mnt/winbackup";
"browseable" = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
};
};
};
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
environment.systemPackages = [pkgs.samba];
}