1{
2 stdenv,
3 lib,
4 fetchFromGitLab,
5 pkg-config,
6 yaml-cpp,
7 libevdev,
8}:
9
10stdenv.mkDerivation rec {
11 pname = "dual-function-keys";
12 version = "1.5.0";
13
14 src = fetchFromGitLab {
15 group = "interception";
16 owner = "linux/plugins";
17 repo = pname;
18 rev = version;
19 hash = "sha256-m/oEczUNKqj0gs/zMOIBxoQaffNg+YyPINMXArkATJ4=";
20 };
21
22 nativeBuildInputs = [ pkg-config ];
23
24 buildInputs = [
25 libevdev
26 yaml-cpp
27 ];
28
29 prePatch = ''
30 substituteInPlace config.mk --replace \
31 '/usr/include/libevdev-1.0' \
32 "$(pkg-config --cflags libevdev | cut -c 3-)"
33 '';
34
35 installFlags = [
36 "DESTDIR=$(out)"
37 "PREFIX="
38 ];
39
40 meta = with lib; {
41 homepage = "https://gitlab.com/interception/linux/plugins/dual-function-keys";
42 description = "Tap for one key, hold for another";
43 license = licenses.mit;
44 maintainers = with maintainers; [ svend ];
45 platforms = platforms.linux;
46 mainProgram = "dual-function-keys";
47 };
48}