diff --git a/hosts/tilo/configuration.nix b/hosts/tilo/configuration.nix index 6e4a455..531b04a 100644 --- a/hosts/tilo/configuration.nix +++ b/hosts/tilo/configuration.nix @@ -14,6 +14,7 @@ ../../modules/ssh.nix ../../modules/endlessh.nix ../../programs/nano.nix + ./services ]; system = { diff --git a/hosts/tilo/services/default.nix b/hosts/tilo/services/default.nix new file mode 100644 index 0000000..7be23ca --- /dev/null +++ b/hosts/tilo/services/default.nix @@ -0,0 +1,3 @@ +{ + imports = [./nextcloud-cron.nix]; +} diff --git a/hosts/tilo/services/nextcloud-cron.nix b/hosts/tilo/services/nextcloud-cron.nix new file mode 100644 index 0000000..606aee8 --- /dev/null +++ b/hosts/tilo/services/nextcloud-cron.nix @@ -0,0 +1,22 @@ +{pkgs, ...}: { + systemd = { + timers."nextcloud-cron" = { + wantedBy = [""]; + timerConfig = { + OnBootSec = "5m"; + OnUnitActiveSec = "5m"; + Unit = "nextcloud-cron.service"; + }; + }; + services."nextcloud-cron" = { + script = '' + set -eu + ${pkgs.docker}/bin/docker exec -u www-data -it nextcloud-nextcloud-1 php /var/www/html/cron.php + ''; + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + }; + }; +}