nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit def251deb96ad713733fd94bfd6ce4da82dc084e
parent 2b6e4a7c9e2069ba2c1442f50bd4263018d1b7ed
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date:   Sat, 29 Jan 2022 16:30:25 +0300

Add miband4

Diffstat:
Mpkgs/default.nix | 1+
Apkgs/misc/miband4/default.nix | 42++++++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -287,6 +287,7 @@ lib.makeScope newScope ( how-to-use-pvs-studio-free = callPackage ./misc/pvs-studio/how-to-use-pvs-studio-free.nix { }; ish = callPackage ./misc/ish { }; lazyscraper = callPackage ./misc/lazyscraper { }; + miband4 = callPackage ./misc/miband4 { }; morse-talk = callPackage ./misc/morse-talk { }; musig = callPackage ./misc/musig { }; objlab = callPackage ./misc/objlab { }; diff --git a/pkgs/misc/miband4/default.nix b/pkgs/misc/miband4/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchFromGitHub, python3Packages, curses-menu }: + +python3Packages.buildPythonApplication rec { + pname = "miband4"; + version = "2021-03-31"; + + src = fetchFromGitHub { + owner = "satcar77"; + repo = pname; + rev = "4fdf6e9b4f4c5fd5c90b4ce2fbe5965d6bb82ea7"; + hash = "sha256-vLY9NhlZPCqqLvv6yW6L2gt0zwGGrxDmQK9+Z3PLVqI="; + }; + + dontUseSetuptoolsBuild = true; + dontUseSetuptoolsCheck = true; + + installPhase = + let + pythonEnv = python3Packages.python.withPackages (p: with p; [ + bluepy + pycrypto + curses-menu + ]); + in + '' + site_packages=$out/lib/${python3Packages.python.libPrefix}/site-packages + mkdir -p $site_packages + cp *.py $site_packages + + makeWrapper ${pythonEnv.interpreter} $out/bin/miband4_console \ + --add-flags "$site_packages/miband4_console.py" + ''; + + meta = with lib; { + description = "Access Xiaomi MiBand 4 from Linux using Bluetooth LE"; + inherit (src.meta) homepage; + license = licenses.free; + maintainers = with maintainers; [ sikmir ]; + platforms = platforms.linux; + skip.ci = stdenv.isDarwin; + }; +}