nix-config/hosts/sisyphe/features/samba-shares.nix

67 lines
1.4 KiB
Nix
Raw Normal View History

2024-07-15 16:46:14 +02:00
{ config, lib, ... }:
2024-12-23 15:19:58 +01:00
with lib;
2024-07-15 16:27:23 +02:00
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;
2024-12-24 14:38:29 +01:00
settings = ''
2024-07-15 16:27:23 +02:00
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";
2024-12-23 14:39:18 +01:00
"directory mask" = "0655";
2024-07-15 16:27:23 +02:00
};
ebooks = {
path = "${cfg.dir}/Ebooks";
browseable = "yes";
"read only" = "no";
"create mask" = "0644";
2024-12-23 14:39:18 +01:00
"directory mask" = "0655";
2024-07-15 16:27:23 +02:00
};
movies = {
path = "${cfg.dir}/Films";
browseable = "yes";
"create mask" = "0644";
2024-12-23 14:39:18 +01:00
"directory mask" = "0655";
2024-07-15 16:27:23 +02:00
"read only" = "no";
};
shows = {
path = "${cfg.dir}/SeriesTV";
"read only" = "no";
"create mask" = "0644";
"directory mask" = "0755";
browseable = "yes";
};
2024-12-23 14:39:18 +01:00
torrents = {
path = "${cfg.dir}/Torrents";
"read only" = "yes";
"create mask" = "644";
browseable = "yes";
};
};
};
};
}