about summary refs log tree commit diff
path: root/pkgs/development/python-modules/py3buddy/default.nix
blob: 2b3f3f48f1375966b8f3181f7ce0da8878213d76 (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
34
35
36
37
38
39
40
41
{ lib, stdenv
, fetchFromGitHub
, python
, pyusb
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "py3buddy";
  version = "1.0";

  src = fetchFromGitHub {
    owner = "armijnhemel";
    repo = "py3buddy";
    rev = finalAttrs.version;
    hash = "sha256-KJ0xGEXHY6o2074WFZ0u7gATS+wrrjyzanYretckWYk=";
  };

  propagatedBuildInputs = [ pyusb ];

  dontConfigure = true;
  dontBuild = true;

  installPhase = ''
    runHook preInstall

    install -D py3buddy.py $out/${python.sitePackages}/py3buddy.py

    runHook postInstall
  '';

  postInstall = ''
    install -D 99-ibuddy.rules $out/lib/udev/rules.d/99-ibuddy.rules
  '';

  meta = {
    description = "Code to work with the iBuddy MSN figurine";
    homepage = "https://github.com/armijnhemel/py3buddy";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ prusnak ];
  };
})