From 84fec74020b178a78491ed1137acf816b330b9bf Mon Sep 17 00:00:00 2001
From: sils <sils@sils.li>
Date: Fri, 6 Oct 2023 18:04:29 +0200
Subject: feat(sys/services/upower): add

---
 sys/services/default.nix        |  1 +
 sys/services/upower/default.nix | 10 ++++++++++
 2 files changed, 11 insertions(+)
 create mode 100644 sys/services/upower/default.nix

(limited to 'sys')

diff --git a/sys/services/default.nix b/sys/services/default.nix
index 8c396b6..a5a459e 100644
--- a/sys/services/default.nix
+++ b/sys/services/default.nix
@@ -5,5 +5,6 @@
     ./logind
     ./printing
     ./tlp
+    ./upower
   ];
 }
diff --git a/sys/services/upower/default.nix b/sys/services/upower/default.nix
new file mode 100644
index 0000000..bd9d0be
--- /dev/null
+++ b/sys/services/upower/default.nix
@@ -0,0 +1,10 @@
+{...}: {
+  services.upower = {
+    enable = true;
+    usePercentageForPolicy = true;
+    percentageLow = 10;
+    percentageCritical = 5;
+    percentageAction = 1;
+    criticalPowerAction = "Hibernate";
+  };
+}
-- 
cgit 1.4.1