zaphyra's git: nixfiles

zaphyra's nixfiles

commit 7266e7c0bcad7f83a7e67ec05cd636a7fb13a7eb
parent ef76d6135db54e521da0c072524ba211bbfc2834
Author: Katja Ramona Sophie Kwast (zaphyra) <git@zaphyra.eu>
Date: Sat, 28 Jun 2025 11:28:17 +0200

config/nixos/modules/services: add `upower`
1 file changed, 27 insertions(+), 0 deletions(-)
A
config/nixos/modules/services/upower.nix
|
27
+++++++++++++++++++++++++++
diff --git a/config/nixos/modules/services/upower.nix b/config/nixos/modules/services/upower.nix
@@ -0,0 +1,27 @@
+{
+  povSelf,
+  config,
+  lib,
+  ...
+}:
+let
+  inherit (lib) types;
+  cfg = lib.getAttrFromPath povSelf config;
+
+in
+{
+
+  options.enable = {
+    type = types.bool;
+    default = false;
+  };
+
+  config = lib.mkIf cfg.enable {
+    modules.filesystem.impermanence.system.dirs = [
+      "/var/lib/upower"
+    ];
+
+    services.upower.enable = true;
+  };
+
+}