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-14 15:48:01 +02:00
|
|
|
{
|
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 = {
|
|
|
|
path = "${cfg.dir}/Music";
|
|
|
|
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";
|
|
|
|
};
|
2024-07-14 15:48:01 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|