feat: Add smb share

This commit is contained in:
uttarayan21
2025-02-01 20:13:31 +05:30
parent c655a56242
commit e86974c618
3 changed files with 45 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
imports = [
# Include the results of the hardware scan.
./ryu.nix
./services
];
programs = {

View File

@@ -0,0 +1,7 @@
{...}: {
imports = [
./samba.nix
];
# services = {
# };
}

View File

@@ -0,0 +1,37 @@
{...}: {
services = {
samba = {
enable = true;
securityType = "user";
openFirewall = true;
settings = {
global = {
"workgroup" = "WORKGROUP";
"server string" = "smbnix";
"netbios name" = "smbnix";
"security" = "user";
"hosts allow" = "192.168.11. 127.0.0.1 localhost";
"hosts deny" = "0.0.0.0/0";
"guest account" = "nobody";
"map to guest" = "bad user";
};
public = {
"path" = "/media";
"browseable" = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0644";
"directory mask" = "0755";
# "force user" = "username";
# "force group" = "groupname";
};
};
};
samba-wsdd = {
enable = true;
openFirewall = true;
};
};
networking.firewall.allowPing = true;
}