nur-packages

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

default.nix (1220B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchFromGitHub,
      5   python3Packages,
      6   curses-menu,
      7 }:
      8 
      9 python3Packages.buildPythonApplication {
     10   pname = "miband4";
     11   version = "0-unstable-2022-10-07";
     12   format = "other";
     13 
     14   src = fetchFromGitHub {
     15     owner = "satcar77";
     16     repo = "miband4";
     17     rev = "166f15bd6a3534fc1054501025a79d8d4db83f12";
     18     hash = "sha256-18ymMXMZLvC3JDCVgvSOQYHg7U3s76HHdVmiQEoBJzo=";
     19   };
     20 
     21   dontUseSetuptoolsBuild = true;
     22   dontUseSetuptoolsCheck = true;
     23 
     24   installPhase =
     25     let
     26       pythonEnv = python3Packages.python.withPackages (
     27         p: with p; [
     28           bluepy
     29           pycrypto
     30           curses-menu
     31         ]
     32       );
     33     in
     34     ''
     35       site_packages=$out/lib/${python3Packages.python.libPrefix}/site-packages
     36       mkdir -p $site_packages
     37       cp *.py $site_packages
     38 
     39       makeWrapper ${pythonEnv.interpreter} $out/bin/miband4_console \
     40         --add-flags "$site_packages/miband4_console.py"
     41     '';
     42 
     43   meta = {
     44     description = "Access Xiaomi MiBand 4 from Linux using Bluetooth LE";
     45     homepage = "https://github.com/satcar77/miband4";
     46     license = lib.licenses.mit;
     47     maintainers = [ lib.maintainers.sikmir ];
     48     platforms = lib.platforms.linux;
     49     skip.ci = stdenv.isDarwin;
     50   };
     51 }