summaryrefslogtreecommitdiff
path: root/hosts/kyren-laptop
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-02-27 17:21:44 +0200
committerKyren223 <Kyren223@proton.me>2025-02-27 17:21:44 +0200
commit15347b8879bfadeded9c2d8beefa880413cb9fb8 (patch)
tree9d11e3e799b63f12d505f2fabf35f1cae046d45a /hosts/kyren-laptop
parent9a150723559868a827922ccf21d5530a03cbf3e2 (diff)
Added systemd timer to automatically track sleeping schedule
(technically tracks when the PC is on/off)
Diffstat (limited to 'hosts/kyren-laptop')
-rw-r--r--hosts/kyren-laptop/configuration.nix19
1 files changed, 15 insertions, 4 deletions
diff --git a/hosts/kyren-laptop/configuration.nix b/hosts/kyren-laptop/configuration.nix
index 82b2248..2e86d95 100644
--- a/hosts/kyren-laptop/configuration.nix
+++ b/hosts/kyren-laptop/configuration.nix
@@ -177,10 +177,21 @@
pkgs.keychain
pkgs.openssh
];
- serviceConfig = {
- Type = "oneshot";
- User = "kyren";
- };
+ serviceConfig = { Type = "oneshot"; User = "kyren"; };
+ };
+
+ systemd.timers."k-sleep-tracker" = {
+ wantedBy = [ "timers.target" ];
+ timerConfig = {
+ OnBootSec = "1m";
+ OnUnitActiveSec = "1m";
+ Unit = "k-sleep-tracker.service";
+ };
+ };
+
+ systemd.services."k-sleep-tracker" = {
+ script = "$HOME/projects/k/bin/k tracker sleep";
+ serviceConfig = { Type = "oneshot"; User = "kyren"; };
};
# Enable KVM/QEMU virtualization