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