nur-packages

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

commit cd2104221e2d4813d144a25addef2ff2f61b3461
parent def251deb96ad713733fd94bfd6ce4da82dc084e
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date:   Sat, 29 Jan 2022 16:54:49 +0300

Add huami-token

Diffstat:
Mpkgs/default.nix | 1+
Apkgs/misc/huami-token/default.nix | 39+++++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -285,6 +285,7 @@ lib.makeScope newScope ( gef = callPackage ./misc/gef { }; glauth = callPackage ./misc/glauth { }; how-to-use-pvs-studio-free = callPackage ./misc/pvs-studio/how-to-use-pvs-studio-free.nix { }; + huami-token = callPackage ./misc/huami-token { }; ish = callPackage ./misc/ish { }; lazyscraper = callPackage ./misc/lazyscraper { }; miband4 = callPackage ./misc/miband4 { }; diff --git a/pkgs/misc/huami-token/default.nix b/pkgs/misc/huami-token/default.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchFromGitHub, python3Packages }: + +python3Packages.buildPythonApplication rec { + pname = "huami-token"; + version = "2021-10-30"; + + src = fetchFromGitHub { + owner = "argrento"; + repo = pname; + rev = "c88162682dd16671ea22ea0e8e6f913494b3bd78"; + hash = "sha256-LMVFlpMueQV8jfX2A968AYftIT2pAe+FTOS7X21ml8w="; + }; + + dontUseSetuptoolsBuild = true; + dontUseSetuptoolsCheck = true; + + installPhase = + let + pythonEnv = python3Packages.python.withPackages (p: with p; [ + requests + rich + ]); + in + '' + site_packages=$out/lib/${python3Packages.python.libPrefix}/site-packages + mkdir -p $site_packages + cp *.py $site_packages + + makeWrapper ${pythonEnv.interpreter} $out/bin/huami_token \ + --add-flags "$site_packages/huami_token.py" + ''; + + meta = with lib; { + description = "Script to obtain watch or band bluetooth token from Huami servers"; + inherit (src.meta) homepage; + license = licenses.free; + maintainers = with maintainers; [ sikmir ]; + }; +}