Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions pkgs/development/python-modules/godirect/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
hidapi,
bleak,
}:

# IMPORTANT: You need permissions to access the usb devices.
# Add services.udev.packages = [ pkgs.python3Packages.godirect ] to your configuration.nix

buildPythonPackage {
pname = "godirect";
version = "1.1.4";
pyproject = true;

src = fetchFromGitHub {
owner = "VernierST";
repo = "godirect-py";
# https://github.com/VernierST/godirect-py/issues/34
rev = "e1ce7c512974587840d9081c5ee03dcd246fd2b3";
hash = "sha256-YIi3U/txlocBTSfxQpvkN1BIc+bLPWoH1FRe85EEMuU=";
};

build-system = [
setuptools
];

dependencies = [
hidapi
bleak
];

# has no tests
doCheck = false;

postInstall = ''
mkdir -p $out/etc/udev/rules.d
echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="08f7", MODE="0660", TAG+="uaccess"' > $out/etc/udev/rules.d/70-vernier-godirect.rules
'';

meta = {
description = "Library to interface with GoDirect devices via USB and BLE";
homepage = "https://github.com/vernierst/godirect-py";
license = [ lib.licenses.gpl3Only ];
maintainers = [ lib.maintainers.axka ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5920,6 +5920,8 @@ self: super: with self; {

gocardless-pro = callPackage ../development/python-modules/gocardless-pro { };

godirect = callPackage ../development/python-modules/godirect { };

goocalendar = callPackage ../development/python-modules/goocalendar { };

goodwe = callPackage ../development/python-modules/goodwe { };
Expand Down
Loading