From a9f6470dc283b2a9a0a6fefc6d935932f001015c Mon Sep 17 00:00:00 2001 From: strix Date: Fri, 28 Aug 2026 02:20:28 +0200 Subject: [PATCH] feat: backups wake and sleep device --- modules/backups/default.nix | 9 +++++++++ modules/home-manager/zsh.nix | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/backups/default.nix b/modules/backups/default.nix index 986ce31..b106159 100644 --- a/modules/backups/default.nix +++ b/modules/backups/default.nix @@ -43,7 +43,16 @@ timerConfig = { OnCalendar = "daily"; Persistent = true; + WakeSystem = true; 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 + ''; }; } diff --git a/modules/home-manager/zsh.nix b/modules/home-manager/zsh.nix index 5ec0bbc..0a9010a 100644 --- a/modules/home-manager/zsh.nix +++ b/modules/home-manager/zsh.nix @@ -1,4 +1,4 @@ -{ username, ... }: +{ username, pkgs, ... }: { programs.zsh = { enable = true; @@ -6,6 +6,9 @@ enable = true; theme = "nanotech"; }; + initContent = '' + ${pkgs.pfetch}/bin/pfetch + ''; sessionVariables = { SSH_AUTH_SOCK = "/home/${username}/.bitwarden-ssh-agent.sock"; };