about summary refs log tree commit diff
path: root/nixos/modules/tasks
diff options
context:
space:
mode:
authornikstur <nikstur@outlook.com>2023-10-29 00:05:14 +0200
committernikstur <nikstur@outlook.com>2023-12-29 03:22:25 +0100
commit9b29bc0010a9cee3236511f70f36b8ae95887f5c (patch)
tree84c5b981cbab1e79739189491a9e8da9c816a2f1 /nixos/modules/tasks
parent36f2ab21eae7b7924f7bbeb62f7453a9d94defbc (diff)
downloadnixlib-9b29bc0010a9cee3236511f70f36b8ae95887f5c.tar
nixlib-9b29bc0010a9cee3236511f70f36b8ae95887f5c.tar.gz
nixlib-9b29bc0010a9cee3236511f70f36b8ae95887f5c.tar.bz2
nixlib-9b29bc0010a9cee3236511f70f36b8ae95887f5c.tar.lz
nixlib-9b29bc0010a9cee3236511f70f36b8ae95887f5c.tar.xz
nixlib-9b29bc0010a9cee3236511f70f36b8ae95887f5c.tar.zst
nixlib-9b29bc0010a9cee3236511f70f36b8ae95887f5c.zip
nixos/trackpoint: replace activationScript
Replace with a separate systemd service ordered before sysinit.target
Diffstat (limited to 'nixos/modules/tasks')
-rw-r--r--nixos/modules/tasks/trackpoint.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/nixos/modules/tasks/trackpoint.nix b/nixos/modules/tasks/trackpoint.nix
index d197a0feb337..317613b84792 100644
--- a/nixos/modules/tasks/trackpoint.nix
+++ b/nixos/modules/tasks/trackpoint.nix
@@ -80,10 +80,17 @@ with lib;
         ACTION=="add|change", SUBSYSTEM=="input", ATTR{name}=="${cfg.device}", ATTR{device/speed}="${toString cfg.speed}", ATTR{device/sensitivity}="${toString cfg.sensitivity}"
       '';
 
-      system.activationScripts.trackpoint =
-        ''
-          ${config.systemd.package}/bin/udevadm trigger --attr-match=name="${cfg.device}"
+      systemd.services.trackpoint = {
+        wantedBy = [ "sysinit.target" ] ;
+        before = [ "sysinit.target" "shutdown.target" ];
+        conflicts = [ "shutdown.target" ];
+        unitConfig.DefaultDependencies = false;
+        serviceConfig.Type = "oneshot";
+        serviceConfig.RemainAfterExit = true;
+        serviceConfig.ExecStart = ''
+          ${config.systemd.package}/bin/udevadm trigger --attr-match=name="${cfg.device}
         '';
+      };
     })
 
     (mkIf (cfg.emulateWheel) {