default.nix (1063B)
1 # this is unlikely to be the final form or location of this code, it's 2 # an interim module which wraps the uevent-watch command 3 4 { 5 lib, 6 pkgs, 7 config, 8 ... 9 }: 10 let 11 inherit (lib) mkOption types; 12 inherit (pkgs) liminix; 13 in 14 # inherit (pkgs.liminix.services) bundle; 15 { 16 options = { 17 system.service.uevent-rule = mkOption { 18 description = "a service which starts other services based on device state (sysfs)"; 19 type = liminix.lib.types.serviceDefn; 20 }; 21 }; 22 config = { 23 system.service.uevent-rule = config.system.callService ./rule.nix { 24 serviceName = mkOption { 25 description = "name of the service to run when the rule matches"; 26 type = types.str; 27 }; 28 terms = mkOption { 29 type = types.attrs; 30 example = { 31 devtype = "usb_device"; 32 attrs.idVendor = "8086"; 33 }; 34 default = { }; 35 }; 36 symlink = mkOption { 37 description = "create symlink targeted on devpath"; 38 type = types.nullOr types.str; 39 default = null; 40 }; 41 }; 42 }; 43 }