about summary refs log tree commit diff
path: root/pkgs/tools/misc/cp210x-program/default.nix
blob: b734008fad2a9844cb03daaae4938a1b5f06dd5b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ lib
, python3
, fetchFromGitHub
}:

python3.pkgs.buildPythonApplication rec {
  pname = "cp210x-program";
  version = "0.4.1";

  src = fetchFromGitHub {
    owner = "VCTLabs";
    repo = "cp210x-program";
    rev = "refs/tags/${version}";
    sha256 = "sha256-IjKshP12WfFly9cPm6svD4qZW6cT8C7lOVrGenSqbfY=";
  };

  propagatedBuildInputs = with python3.pkgs; [
    hexdump
    pyusb
  ];

  postInstall = ''
    ln -s $out/bin/cp210x-program{.py,}
  '';

  meta = with lib; {
    description = "EEPROM tool for Silabs CP210x USB-Serial adapter";
    homepage = "https://github.com/VCTLabs/cp210x-program";
    license = licenses.lgpl21Only; # plus/only status unclear
    maintainers = with maintainers; [ ckie ];
    mainProgram = "cp210x-program";
  };
}