Commit b539291a7c90

Vincent Demeester <vincent@sbr.pm>
2025-06-17 23:27:20
systems/kyushu: add a battery-monitor user service
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 1c7471c
Changed files (1)
systems
kyushu
systems/kyushu/home.nix
@@ -1,5 +1,27 @@
-_: {
+{ pkgs, ... }:
+{
   imports = [
     ../../home/common/dev/containers.nix
   ];
+
+  systemd.user.services.battery-monitor = {
+    Unit = {
+      Description = "battery monitory service";
+      After = "graphical-session.target";
+      PartOf = "graphical-session.target";
+
+      # Avoid killing the Emacs session, which may be full of
+      # unsaved buffers.
+      X-RestartIfChanged = false;
+    };
+    Service = {
+      ExecStart = ''
+        ${pkgs.battery-monitor}
+      '';
+      Restart = "on-failure";
+    };
+    Install = {
+      WantedBy = [ "graphical-session.target" ];
+    };
+  };
 }