about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/bluetooth_battery/default.nix
blob: 4158cdf8cc5595e35ba26f8ab5d9c10eadad4aec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ 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 ];
  };
}