nixpkgs/pkgs/applications/science/robotics/betaflight-configurator/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

50 lines
1.6 KiB
Nix

{lib, stdenv, fetchurl, unzip, makeDesktopItem, nwjs, wrapGAppsHook, gsettings-desktop-schemas, gtk3 }:
let
pname = "betaflight-configurator";
desktopItem = makeDesktopItem {
name = pname;
exec = pname;
icon = pname;
comment = "Betaflight configuration tool";
desktopName = "Betaflight Configurator";
genericName = "Flight controller configuration tool";
};
in
stdenv.mkDerivation rec {
inherit pname;
version = "10.7.0";
src = fetchurl {
url = "https://github.com/betaflight/${pname}/releases/download/${version}/${pname}_${version}_linux64.zip";
sha256 = "07r60n9422g5sm7x5b62p044cp961l51vx0s8ig2hy24s74hkam1";
};
nativeBuildInputs = [ wrapGAppsHook ];
buildInputs = [ unzip gsettings-desktop-schemas gtk3 ];
installPhase = ''
mkdir -p $out/bin \
$out/opt/${pname}
cp -r . $out/opt/${pname}/
install -m 444 -D icon/bf_icon_128.png $out/share/icons/hicolor/128x128/apps/${pname}.png
cp -r ${desktopItem}/share/applications $out/share/
makeWrapper ${nwjs}/bin/nw $out/bin/${pname} --add-flags $out/opt/${pname}
'';
meta = with lib; {
description = "The Betaflight flight control system configuration tool";
longDescription = ''
A crossplatform configuration tool for the Betaflight flight control system.
Various types of aircraft are supported by the tool and by Betaflight, e.g.
quadcopters, hexacopters, octocopters and fixed-wing aircraft.
'';
homepage = "https://github.com/betaflight/betaflight/wiki";
license = licenses.gpl3;
maintainers = with maintainers; [ wucke13 ];
platforms = platforms.linux;
};
}