1
1
Fork 0

catacomb: remove samba and NAS-related cron

This commit is contained in:
Tim Van Baak 2024-06-28 23:21:05 +00:00
parent c2d7910800
commit 7ab342adad
1 changed files with 0 additions and 91 deletions

View File

@ -26,8 +26,6 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
lsof # list open files lsof # list open files
mkpasswd # used for setting SMB passwords, I think?
samba # provides smbpasswd, mostly
smartmontools # provides smartctl smartmontools # provides smartctl
usbutils # provides lsusb usbutils # provides lsusb
]; ];
@ -43,101 +41,12 @@
services.cron = { services.cron = {
enable = true; enable = true;
systemCronJobs =
let
reassertPerms = pkgs.writeShellScript "reassert-nas-permissions.sh" ''
${pkgs.coreutils}/bin/chown -v -R tvb:nas /nas
${pkgs.findutils}/bin/find /nas -type d -exec ${pkgs.coreutils}/bin/chmod -v 750 {} \;
${pkgs.findutils}/bin/find /nas -type f -exec ${pkgs.coreutils}/bin/chmod -v 640 {} \;
'';
in [
"0 20 * * 1 root ${reassertPerms}"
"0 0 * * 1 tvb . /etc/profile; /home/tvb/gitea-backup"
];
}; };
services.openssh.settings.PasswordAuthentication = true; services.openssh.settings.PasswordAuthentication = true;
services.rsyncd.enable = true; services.rsyncd.enable = true;
services.samba =
let
sambaShare = path: validUsers: {
path = path;
comment = "Samba share for ${path}";
browseable = "yes";
"read only" = "no";
"guest okay" = "no";
"create mask" = "0640";
"force create mode" = "0640";
"directory mask" = "0750";
"force directory mode" = "0750";
"valid users" = validUsers;
"force group" = ''nas'';
};
sambaShareRO = path: validUsers: {
path = path;
comment = "Read-only Samba share for ${path}";
browseable = "yes";
"read only" = "yes";
"guest okay" = "no";
"valid users" = validUsers;
"force group" = ''nas'';
};
in
{
enable = true;
securityType = "user";
extraConfig = ''
workgroup = beatific
server string = Catacomb Nix SMB
netbios name = catacomb
deadtime = 300
local master = yes
domain master = yes
preferred master = yes
guest account = nobody
map to guest = bad user
case sensitive = yes
veto files = /^.DS_Store$/^.Trash-1000$/
load printers = no
printcap name = /dev/null
printing = bsd
log file = /var/log/samba/client-%m.log
log level = 2
max log size = 64
hide dot files = no
hosts allow = 10.22.20., 192.168.1.
map archive = no
unix extensions = yes
ntlm auth = yes
'';
shares = let
homeShare = user: {
path = "/home/${user}";
comment = "${user}'s home folder";
browseable = "yes";
"read only" = "no";
"guest okay" = "no";
"create mask" = "0640";
"force create mode" = "0640";
"directory mask" = "0750";
"force directory mode" = "0750";
"valid users" = "${user}";
};
in {
tvb = homeShare "tvb";
katydid = homeShare "katydid";
};
};
services.zfs = { services.zfs = {
autoScrub = { autoScrub = {
enable = true; enable = true;