From 049b93b57559a743660dc9edc382e89154f592fc Mon Sep 17 00:00:00 2001 From: 514fpv Date: Fri, 12 Jan 2024 17:50:48 +0800 Subject: [PATCH] feat: add BLHeliSuite32 --- home/util/home.nix | 2 ++ home/util/package/blheli32.nix | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 home/util/package/blheli32.nix diff --git a/home/util/home.nix b/home/util/home.nix index cd116457..20b75065 100644 --- a/home/util/home.nix +++ b/home/util/home.nix @@ -14,5 +14,7 @@ betaflight-configurator inav-configurator inav-blackbox-tools + + (pkgs.callPackage ./package/blheli32.nix { }) ]; } diff --git a/home/util/package/blheli32.nix b/home/util/package/blheli32.nix new file mode 100644 index 00000000..18a652f9 --- /dev/null +++ b/home/util/package/blheli32.nix @@ -0,0 +1,28 @@ +{ stdenvNoCC +, lib +, fetchzip +, buildFHSUserEnv }: let + name = "BLHeliSuite32"; + pname = "blhelisuite32"; + version = "32.10"; + + dist = fetchzip { + name = "${pname}-dist"; + url = "https://github.com/bitdump/BLHeli/releases/download/Rev${version}/${name}xLinux64_1044.zip"; + hash = "sha256-7BuB/Mn5W8oOKePindxiOwPqCo2M67JEBHzD/CiQWAc="; + + postFetch = '' + # BLHeliSuite32 tries to write next to its binary + ln -s /tmp/${pname}_settings $out/Settings + ''; + }; +in buildFHSUserEnv { + inherit pname; + targetPkgs = pkgs: (with pkgs; [ + glib libGL curl + libgcc gtk3 + zlib systemdLibs + ]); + + runScript = "sh -c 'mkdir -p /tmp/blhelisuite32_settings && exec ${dist}/${name}xl'"; +}