nixos-config/configurations/host/waffentrager/services/samba.nix

56 lines
1.8 KiB
Nix
Raw Normal View History

2024-07-12 15:53:54 +02:00
{ lib, pkgs, materusArg, config, ... }:
{
options.waffentragerService.samba.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable samba";
config =
let
cfg = config.waffentragerService.samba;
in
lib.mkIf cfg.enable {
2024-07-13 15:44:07 +02:00
waffentragerService.elements.enable = true;
systemd.services.samba-nmbd = {
requires = [ "elements-mount.service" ];
after = [ "elements-mount.service" ];
};
systemd.services.samba-wsdd = {
requires = [ "elements-mount.service" ];
after = [ "elements-mount.service" ];
};
2024-07-12 15:53:54 +02:00
services.samba-wsdd.enable = true;
services.samba-wsdd.openFirewall = true;
services.samba = {
enable = true;
package = pkgs.sambaFull;
securityType = "user";
openFirewall = true;
extraConfig = ''
workgroup = WORKGROUP
server string = smbwaffentrager
netbios name = smbwaffentrager
security = user
hosts allow = ${materusArg.wireguard.sambaIp} 192.168.100. 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
mangled names = no
dos charset = CP850
unix charset = UTF-8
2024-09-02 23:20:13 +02:00
catia:mappings = 0x22:0xa8,0x2a:0xa4,0x2f:0xf8,0x3a:0xf7,0x3c:0xab,0x3e:0xbb,0x3f:0xbf,0x5c:0xff,0x7c:0xa6
2024-07-12 15:53:54 +02:00
'';
shares = {
materus = {
path = "${config.waffentragerService.elements.path}/storage/materus";
browseable = "yes";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0770";
"directory mask" = "0770";
2024-07-12 15:53:54 +02:00
"force user" = "materus";
"force group" = "nextcloud";
2024-07-12 15:53:54 +02:00
};
};
};
};
}