about summary refs log tree commit diff
path: root/pkgs/by-name/zm/zmkBATx/package.nix
blob: 82e49e99c95eec7b447f9aab06e7ddd04c997a5f (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  stdenv,
  fetchFromGitHub,
  lib,
  qt6,
  pkg-config,
  dbus,
  simpleBluez,
  simpleDBus,
}:
stdenv.mkDerivation (finalAttrs: {
  pname = "zmkBATx";

  version = "1.0.1";

  src = fetchFromGitHub {
    owner = "mh4x0f";
    repo = "zmkBATx";
    rev = "v${finalAttrs.version}";
    hash = "sha256-xbiwRHVTuaZDH3RZlMK2CpKBThtS8g6q5r3C+OccDZg=";
  };

  nativeBuildInputs = [
    qt6.wrapQtAppsHook
    pkg-config
    qt6.qmake
  ];

  buildInputs = [
    qt6.qtbase
    qt6.qtconnectivity
    dbus.lib
    simpleBluez
    simpleDBus
  ];

  postPatch = ''
    substituteInPlace zmkBATx.pro --replace-fail "/usr/include/dbus-1.0" "${dbus.dev}/include/dbus-1.0"
    substituteInPlace zmkBATx.pro --replace-fail "/usr/lib/x86_64-linux-gnu/dbus-1.0/include" "${dbus.lib}/lib/dbus-1.0/include"
  '';

  meta = with lib; {
    description = "Battery monitoring for ZMK split keyboards";
    longDescription = "Opensource tool for peripheral battery monitoring zmk split keyboard over BLE for linux.";
    homepage = "https://github.com/mh4x0f/zmkBATx";
    license = licenses.mit;
    mainProgram = "zmkbatx";
    platforms = platforms.linux;
    maintainers = with maintainers; [ aciceri ];
  };
})