NixOS/system/services/samba.nix

37 lines
772 B
Nix
Raw Permalink Normal View History

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;
securityType = "user";
openFirewall = true;
extraConfig = ''
workgroup = WORKGROUP
server string = smbnix
netbios name = smbnix
security = user
2024-06-13 16:40:43 +07:00
guest account = ${user.name}
2024-06-13 16:08:33 +07:00
'';
shares = {
nas = {
path = "/nas";
browsable = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0777";
"directory mask" = "0777";
};
};
};
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
};
}