diff --git a/configuration.nix b/configuration.nix index bd1464d..3b9f270 100644 --- a/configuration.nix +++ b/configuration.nix @@ -55,13 +55,20 @@ }; }; - #services.cron = { - # enable = true; - # systemCronJobs = [ - # "0 20 * * 1 root /root/reassert-nas-permissions.sh" - # "0 0 * * 1 tvb . /etc/profile; /home/tvb/gitea-backup" - # ]; - #}; + services.cron = { + 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 = { enable = true;