mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-08-08 06:30:18 +02:00
splitted configs in even more files
This commit is contained in:
parent
4c19ad042f
commit
fb2934c4c7
14 changed files with 371 additions and 121 deletions
|
@ -1,33 +1,57 @@
|
|||
{ username, driveMountPoint }:
|
||||
|
||||
{ lib }:
|
||||
with lib;
|
||||
# TODO: add access to series and TV folders.
|
||||
let
|
||||
cfg = config.samba;
|
||||
in
|
||||
{
|
||||
# enable samba
|
||||
services.samba = {
|
||||
enable = true;
|
||||
securityType = "user";
|
||||
openFirewall = true;
|
||||
extraConfig = ''
|
||||
workgroup = WORKGROUP
|
||||
server string = hyperserver
|
||||
netbios name = hyperserver
|
||||
security = user
|
||||
'';
|
||||
shares = {
|
||||
music = {
|
||||
path = "${driveMountPoint}/Music";
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
"create mask" = "0644";
|
||||
"directory mask" = "0755";
|
||||
"force user" = username;
|
||||
};
|
||||
ebooks = {
|
||||
path = "${driveMountPoint}/Ebooks";
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
"create mask" = "0644";
|
||||
"directory mask" = "0755";
|
||||
"force user" = username;
|
||||
options.samba = {
|
||||
dir = mkOption {
|
||||
type = types.str;
|
||||
default = "/srv/Multimedia";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue