periodic wakeup from suspend

This commit is contained in:
Daniel Langbein 2023-11-05 17:21:29 +01:00
parent dc5241264e
commit 797253fe53
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
2 changed files with 32 additions and 2 deletions

View File

@ -50,7 +50,7 @@
#../../modules/ntfs.nix
#../../modules/veracrypt.nix
#../../modules/btrbk
#../../modules/spin-down.nix # TODO
#../../modules/spin-down.nix
../../modules/btrfs-scrub.nix
../../modules/btrfs-mount-options.nix

View File

@ -1 +1,31 @@
{}
{ config, pkgs, ... }:
{
# Suspend system:
# sudo systemctl suspend
# Power consumption:
# 2.4W powered off
# 2.6W suspended, with 1 RAM, 1 SSD
# journalctl -u regular-wakeup
systemd.timers."regular-wakeup" = {
wantedBy = [ "multi-user.target" ];
timerConfig = {
OnCalendar = [
# Testing
"Sun 16:15:00"
# Daily
# *-*-* 00:00:05
];
WakeSystem = true;
};
};
systemd.services."regular-wakeup" = {
script = ''
set -eu -o pipefail
printf '%s%s\n' 'Wokeup at ' "$(date)"
'';
};
}