ch57x-keyboard-tool: Add udev rules

This commit is contained in:
Andrew Kvalheim 2023-11-06 11:38:33 -08:00
parent 0dc339825b
commit 0d4ab4220a

View file

@ -2,8 +2,14 @@
, lib
, nix-update-script
, rustPlatform
, writeText
}:
let
rules = writeText "ch57x-udev-rules" ''
ATTRS{idVendor}=="1189", ATTRS{idProduct}=="8890", MODE="0660", TAG+="uaccess"
'';
in
rustPlatform.buildRustPackage rec {
pname = "ch57x-keyboard-tool";
version = "1.1.0";
@ -14,6 +20,10 @@ rustPlatform.buildRustPackage rec {
};
cargoHash = "sha256-Jt2pwpPuc9MbS82jCxhFeJpHt0D3VZWYEU0MWporUO8=";
postInstall = ''
install -D ${rules} $out/etc/udev/rules.d/70-ch57x.rules
'';
passthru.updateScript = nix-update-script { };
meta = {