nix-config/features/server/samba-shares.nix

62 lines
1.3 KiB
Nix
Raw Normal View History

2024-07-15 16:46:14 +02:00
{ config, lib, ... }:
2024-07-15 16:27:23 +02:00
with lib;
# TODO: add access to series and TV folders.
let
cfg = config.samba;
in
{
2024-07-15 16:55:05 +02:00
options = {
samba = {
dir = mkOption {
type = types.str;
default = "/srv/Multimedia";
};
2024-07-15 16:27:23 +02:00
};
};
2024-07-17 19:52:30 +02:00
config = {
2024-07-15 16:27:23 +02:00
services.samba = {
enable = true;
securityType = "user";
openFirewall = true;
extraConfig = ''
workgroup = WORKGROUP
server string = hyperserver
netbios name = hyperserver
security = user
'';
shares = {
music = {
2024-08-05 10:28:33 +02:00
path = "/srv/media/Music";
2024-07-15 16:27:23 +02:00
browseable = "yes";
"read only" = "no";
"create mask" = "0644";
"directory mask" = "0755";
};
ebooks = {
path = "${cfg.dir}/Ebooks";
browseable = "yes";
"read only" = "no";
"create mask" = "0644";
"directory mask" = "0755";
};
movies = {
path = "${cfg.dir}/Films";
browseable = "yes";
"create mask" = "0644";
"directory mask" = "0755";
"read only" = "no";
};
shows = {
path = "${cfg.dir}/SeriesTV";
"read only" = "no";
"create mask" = "0644";
"directory mask" = "0755";
browseable = "yes";
};
};
};
};
}