summaryrefslogtreecommitdiffstats
path: root/pkgs/tools/inputmethods/interception-tools/dual-function-keys.nix
blob: 6e362867e26785b6cf54f61ca7a598efd3eb2c5c (plain)
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
{
  stdenv,
  lib,
  fetchFromGitLab,
  pkg-config,
  yaml-cpp,
  libevdev,
}:

stdenv.mkDerivation rec {
  pname = "dual-function-keys";
  version = "1.5.0";

  src = fetchFromGitLab {
    group = "interception";
    owner = "linux/plugins";
    repo = pname;
    rev = version;
    hash = "sha256-m/oEczUNKqj0gs/zMOIBxoQaffNg+YyPINMXArkATJ4=";
  };

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [
    libevdev
    yaml-cpp
  ];

  prePatch = ''
    substituteInPlace config.mk --replace \
      '/usr/include/libevdev-1.0' \
      "$(pkg-config --cflags libevdev | cut -c 3-)"
  '';

  installFlags = [
    "DESTDIR=$(out)"
    "PREFIX="
  ];

  meta = {
    homepage = "https://gitlab.com/interception/linux/plugins/dual-function-keys";
    description = "Tap for one key, hold for another";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ svend ];
    platforms = lib.platforms.linux;
    mainProgram = "dual-function-keys";
  };
}