nixpkgs/pkgs/applications/misc/bluetooth_battery/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

32 lines
855 B
Nix

{ lib, fetchFromGitHub, buildPythonApplication, pybluez }:
buildPythonApplication rec {
pname = "bluetooth_battery";
version = "1.3.1";
src = fetchFromGitHub {
owner = "TheWeirdDev";
repo = "Bluetooth_Headset_Battery_Level";
rev = "v${version}";
sha256 = "067qfxh228cy1x95bnjp88dx4k00ajj7ay7fz5vr1gkj2yfa203s";
};
propagatedBuildInputs = [ pybluez ];
format = "other";
installPhase = ''
mkdir -p $out/bin
cp $src/bluetooth_battery.py $out/bin/bluetooth_battery
'';
meta = with lib; {
description = "Fetch the battery charge level of some Bluetooth headsets";
mainProgram = "bluetooth_battery";
homepage = "https://github.com/TheWeirdDev/Bluetooth_Headset_Battery_Level";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ cheriimoya ];
};
}