2024-06-13 16:08:33 +07:00
|
|
|
{ config, lib, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.profile.services.samba;
|
2024-06-13 16:40:43 +07:00
|
|
|
user = config.profile.user;
|
2024-06-13 16:08:33 +07:00
|
|
|
inherit (lib) mkIf;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.samba = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
2024-11-24 12:07:59 +07:00
|
|
|
settings = {
|
|
|
|
global = {
|
|
|
|
"invalid users" = [ "root" ];
|
|
|
|
workgroup = "WORKGROUP";
|
|
|
|
"server string" = "smbnix";
|
|
|
|
"netbios name" = "smbnix";
|
|
|
|
security = "user";
|
|
|
|
"guest account" = user.name;
|
|
|
|
"passwd program" = "/run/wrappers/bin/passwd %u";
|
|
|
|
};
|
2024-06-13 16:08:33 +07:00
|
|
|
nas = {
|
|
|
|
path = "/nas";
|
|
|
|
browsable = "yes";
|
|
|
|
"read only" = "no";
|
|
|
|
"guest ok" = "yes";
|
|
|
|
"create mask" = "0777";
|
|
|
|
"directory mask" = "0777";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
services.samba-wsdd = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|