commit c8c79fd75a1eebbbe68201be55fce377f9103eda
parent 884d8d194ea904119b4ca50f8751a43e6ac1c9e5
Author: Daniel Barlow <dan@telent.net>
Date: Sun, 2 Jun 2024 20:40:56 +0100
update all calls to uevent-watch
Diffstat:
3 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/modules/cdc-ncm/wwan.nix b/modules/cdc-ncm/wwan.nix
@@ -47,11 +47,9 @@ let
setup = bundle {
name = "modemm-mm-mm-mm";
contents = [
- (longrun {
- name = "watch-for-usb-modeswitch";
- isTrigger = true;
- buildInputs = [ modeswitch ];
- run = "${uevent-watch}/bin/uevent-watch -s ${modeswitch.name} devtype=usb_device product=12d1/14fe/102";
+ (svc.uevent-rule.build {
+ service = modeswitch;
+ terms = { devtype = "usb_device"; product = "12d1/14fe/102"; };
})
(svc.uevent-rule.build {
service = atz;
diff --git a/modules/mount/default.nix b/modules/mount/default.nix
@@ -19,9 +19,9 @@ in {
type = liminix.lib.types.serviceDefn;
};
};
- imports = [ ../mdevd.nix ];
+ imports = [ ../mdevd.nix ../service-trigger ];
config.system.service.mount =
- let svc = liminix.callService ./service.nix {
+ let svc = config.system.callService ./service.nix {
partlabel = mkOption {
type = types.str;
example = "my-usb-stick";
diff --git a/modules/mount/service.nix b/modules/mount/service.nix
@@ -1,7 +1,7 @@
{
liminix
-, uevent-watch
, lib
+, svc
}:
{ partlabel, mountpoint, options, fstype }:
let
@@ -15,12 +15,11 @@ let
up = "mount -t ${fstype} ${options_string} ${device} ${mountpoint}";
down = "umount ${mountpoint}";
};
-in longrun {
- name = "watch-mount.${lib.strings.sanitizeDerivationName mountpoint}";
- isTrigger = true;
- buildInputs = [ mount_service ];
-
- run = ''
- ${uevent-watch}/bin/uevent-watch -s ${mount_service.name} -n ${device} partname=${partlabel} devtype=partition
- '';
+in svc.uevent-rule.build {
+ service = mount_service;
+ symlink = device;
+ terms = {
+ partname = partlabel;
+ devtype = "partition";
+ };
}