2023-08-15 04:46:35 +00:00
|
|
|
{ fetchCrate
|
|
|
|
, lib
|
|
|
|
, nix-update-script
|
|
|
|
, rustPlatform
|
2023-11-06 19:38:33 +00:00
|
|
|
, writeText
|
2023-08-15 04:46:35 +00:00
|
|
|
}:
|
|
|
|
|
2023-11-06 19:38:33 +00:00
|
|
|
let
|
|
|
|
rules = writeText "ch57x-udev-rules" ''
|
|
|
|
ATTRS{idVendor}=="1189", ATTRS{idProduct}=="8890", MODE="0660", TAG+="uaccess"
|
|
|
|
'';
|
|
|
|
in
|
2023-08-15 04:46:35 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "ch57x-keyboard-tool";
|
2024-04-05 17:00:49 +00:00
|
|
|
version = "1.4.0";
|
2023-08-15 04:46:35 +00:00
|
|
|
|
|
|
|
src = fetchCrate {
|
|
|
|
inherit pname version;
|
2024-04-05 17:00:49 +00:00
|
|
|
sha256 = "sha256-Yx+g/gNJaZFcppqo+n9+MInQCXv55UIGXw/ZmJLi+Lk=";
|
2023-08-15 04:46:35 +00:00
|
|
|
};
|
2024-04-05 17:00:49 +00:00
|
|
|
cargoHash = "sha256-B25mUouxgZDEcAKOlsJO9Tretuqps1+3Yy1fMDgvV00=";
|
2023-08-15 04:46:35 +00:00
|
|
|
|
2023-11-06 19:38:33 +00:00
|
|
|
postInstall = ''
|
|
|
|
install -D ${rules} $out/etc/udev/rules.d/70-ch57x.rules
|
|
|
|
'';
|
|
|
|
|
2023-08-15 04:46:35 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Command-line tool for programming ch57x keyboard";
|
|
|
|
homepage = "https://github.com/kriomant/ch57x-keyboard-tool";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
};
|
|
|
|
}
|