feat: Add smb share
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./ryu.nix
|
./ryu.nix
|
||||||
|
./services
|
||||||
];
|
];
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
|||||||
7
nixos/ryu/services/default.nix
Normal file
7
nixos/ryu/services/default.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./samba.nix
|
||||||
|
];
|
||||||
|
# services = {
|
||||||
|
# };
|
||||||
|
}
|
||||||
37
nixos/ryu/services/samba.nix
Normal file
37
nixos/ryu/services/samba.nix
Normal 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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user