diff --git a/hosts/droppie/nextcloud-web-tunnel.nix b/hosts/droppie/nextcloud-web-tunnel.nix index 0b2dbfe6..0f3fd1b2 100644 --- a/hosts/droppie/nextcloud-web-tunnel.nix +++ b/hosts/droppie/nextcloud-web-tunnel.nix @@ -1,5 +1,7 @@ -{ pkgs, ... }: - +{ pkgs, config, ... }: +let + psCfg = config.pub-solar; +in { config = { services.openssh.knownHosts = { diff --git a/hosts/droppie/restic-backup.nix b/hosts/droppie/restic-backup.nix index 6a4a282c..fdfa9fd4 100644 --- a/hosts/droppie/restic-backup.nix +++ b/hosts/droppie/restic-backup.nix @@ -3,34 +3,34 @@ let shutdownWaitMinutes = 15; shutdownScript = pkgs.writeScript "shutdown" '' -STATUS_FILES="/media/internal/backups-pub-solar/status" + STATUS_FILES="/media/internal/backups-pub-solar/status" -running="" + running="" -for f in $STATUS_FILES; do - declare started - declare finished + for f in $STATUS_FILES; do + declare started + declare finished - started=$(source $f ; echo ''${BACKUP_STARTED}) - finished=$(source $f ; echo ''${BACKUP_FINISHED}) + started=$(source $f ; echo ''${BACKUP_STARTED}) + finished=$(source $f ; echo ''${BACKUP_FINISHED}) - if [ -z "''${finished}" ]; then - echo "backup $(dirname $f) still running" - running="yes" - break - fi -done + if [ -z "''${finished}" ]; then + echo "backup $(dirname $f) still running" + running="yes" + break + fi + done -if [ -n "''${running}" ] && [ "''${running}" = "yes" ]; then - echo "backups are still running" - exit 1 -fi + if [ -n "''${running}" ] && [ "''${running}" = "yes" ]; then + echo "backups are still running" + exit 1 + fi -echo "WARNING: System will be shut down within the next 15 minutes" | wall + echo "WARNING: System will be shut down within the next 15 minutes" | wall -sleep 10 + sleep 10 -shutdown -P +${builtins.toString shutdownWaitMinutes} + shutdown -P +${builtins.toString shutdownWaitMinutes} ''; in { @@ -43,7 +43,7 @@ in systemd.timers."shutdown-after-backup" = { enable = true; - serviceConfig = { + timerConfig = { OnCalendar = "3..9:*"; }; };