diff --git a/home/util/home.nix b/home/util/home.nix index 20b75065..384141f0 100644 --- a/home/util/home.nix +++ b/home/util/home.nix @@ -16,5 +16,6 @@ inav-blackbox-tools (pkgs.callPackage ./package/blheli32.nix { }) + (pkgs.callPackage ./package/expresslrs.nix { }) ]; } diff --git a/home/util/package/expresslrs.nix b/home/util/package/expresslrs.nix new file mode 100644 index 00000000..12cebf46 --- /dev/null +++ b/home/util/package/expresslrs.nix @@ -0,0 +1,51 @@ +{ lib +, fetchzip +, makeDesktopItem +, imagemagick +, buildFHSUserEnv }: let + name = "ExpressLRS-Configurator"; + pname = "expresslrs-configurator"; + version = "1.6.1"; + + dist = fetchzip { + name = "${pname}-dist"; + url = "https://github.com/ExpressLRS/ExpressLRS-Configurator/releases/download/v${version}/${pname}-${version}.zip"; + stripRoot = false; + hash = "sha256-m/e8dsOadjk63cwfnnCBbjXzI/ooWZUGRM5n267JmhQ="; + }; + + desktopItem = makeDesktopItem { + name = pname; + exec = pname; + icon = pname; + comment = "Cross platform configuration & build tool for the ExpressLRS radio link"; + desktopName = "ExpressLRS Configurator"; + genericName = "radio link configuration & build tool"; + }; +in buildFHSUserEnv { + inherit pname; + # copied from chromium deps + targetPkgs = pkgs: (with pkgs; [ + glib fontconfig freetype pango cairo xorg.libX11 xorg.libXi atk nss nspr + xorg.libXcursor xorg.libXext xorg.libXfixes xorg.libXrender + xorg.libXScrnSaver xorg.libXcomposite xorg.libxcb + alsa-lib xorg.libXdamage xorg.libXtst xorg.libXrandr xorg.libxshmfence expat cups + dbus gdk-pixbuf gcc-unwrapped.lib + systemd + libexif pciutils + liberation_ttf curl util-linux wget + flac harfbuzz icu libpng libopus snappy speechd + bzip2 libcap at-spi2-atk at-spi2-core + libkrb5 libdrm libglvnd mesa coreutils + libxkbcommon pipewire wayland + libva gtk3 gtk4 + ]); + extraInstallCommands = '' + mkdir -p $out/share + ${imagemagick}/bin/convert ${dist}/resources/assets/icon.png -resize 128x128 icon-128.png + install -m 444 -D icon-128.png $out/share/icons/hicolor/128x128/apps/${pname}.png + cp -r ${desktopItem}/share/applications $out/share/ + ''; + + runScript = "${dist}/expresslrs-configurator"; +}