{ config, lib, pkgs, ... }: let jawzTasks = pkgs.writeScriptBin "tasks" (builtins.readFile ../../scripts/tasks.sh); description = "Run a tasks script which keeps a lot of things organized"; in { systemd.user = { services.tasks = { restartIfChanged = true; description = description; wantedBy = [ "default.target" ]; path = [ pkgs.bash pkgs.nix jawzTasks ]; serviceConfig = { Restart = "on-failure"; RestartSec = 30; ExecStart = "${jawzTasks}/bin/tasks"; }; }; timers.tasks = { enable = true; description = description; wantedBy = [ "timers.target" ]; timerConfig = { OnCalendar = "*:0/10"; }; }; }; }