feat: backups wake and sleep device

This commit is contained in:
strix 2026-08-28 02:20:28 +02:00
parent 83c51f89a9
commit a9f6470dc2
2 changed files with 13 additions and 1 deletions

View file

@ -43,7 +43,16 @@
timerConfig = { timerConfig = {
OnCalendar = "daily"; OnCalendar = "daily";
Persistent = true; Persistent = true;
WakeSystem = true;
RandomizedDelaySec = "5h"; RandomizedDelaySec = "5h";
}; };
backupCleanupCommand = ''
loginctl list-sessions --no-legend | awk '{print $1}' | while read -r s; do
class=$(loginctl show-session "$s" -p Class --value)
if [ "$class" = "user" ]; then
loginctl show-session "$s" -p LockedHint --value
fi
done | grep -qx no && echo "unlocked session found skip suspend" || systemctl suspend
'';
}; };
} }

View file

@ -1,4 +1,4 @@
{ username, ... }: { username, pkgs, ... }:
{ {
programs.zsh = { programs.zsh = {
enable = true; enable = true;
@ -6,6 +6,9 @@
enable = true; enable = true;
theme = "nanotech"; theme = "nanotech";
}; };
initContent = ''
${pkgs.pfetch}/bin/pfetch
'';
sessionVariables = { sessionVariables = {
SSH_AUTH_SOCK = "/home/${username}/.bitwarden-ssh-agent.sock"; SSH_AUTH_SOCK = "/home/${username}/.bitwarden-ssh-agent.sock";
}; };