nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, fetchFromGitHub, buildPythonApplication, pybluez }:
2
3buildPythonApplication rec {
4 pname = "bluetooth_battery";
5 version = "1.3.1";
6
7 src = fetchFromGitHub {
8 owner = "TheWeirdDev";
9 repo = "Bluetooth_Headset_Battery_Level";
10 rev = "v${version}";
11 sha256 = "067qfxh228cy1x95bnjp88dx4k00ajj7ay7fz5vr1gkj2yfa203s";
12 };
13
14 propagatedBuildInputs = [ pybluez ];
15
16 format = "other";
17
18 installPhase = ''
19 mkdir -p $out/bin
20 cp $src/bluetooth_battery.py $out/bin/bluetooth_battery
21 '';
22
23 meta = with lib; {
24 description = "Fetch the battery charge level of some Bluetooth headsets";
25 homepage = "https://github.com/TheWeirdDev/Bluetooth_Headset_Battery_Level";
26 license = licenses.gpl3Plus;
27 platforms = platforms.unix;
28 maintainers = with maintainers; [ cheriimoya ];
29 };
30}