about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/services/upower-minimal.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/services/upower-minimal.nix b/modules/services/upower-minimal.nix
index 25de830d..215e47dc 100644
--- a/modules/services/upower-minimal.nix
+++ b/modules/services/upower-minimal.nix
@@ -20,6 +20,8 @@ let
     ];
   });
 
+  configFile = ini.generate "UPower.conf" cfg.settings;
+
 in
 
 {
@@ -66,7 +68,6 @@ in
 
   config = lib.mkIf cfg.enable {
 
-
     # this is … questionable … l o w  e f f o r t
 
     environment.systemPackages = [ pkg ];
@@ -77,8 +78,10 @@ in
 
     systemd.packages = [ pkg ];
 
-    environment.etc."UPower/UPower.conf".source =
-      ini.generate "UPower.conf" cfg.settings;
+    # this implicitly assumes the package has a `upower.service` unit file
+    systemd.services."upower".restartTriggers = [ configFile ];
+
+    environment.etc."UPower/UPower.conf".source = configFile ;
   };
 
 }