about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/inputmethods/interception-tools/dual-function-keys.nix
blob: 730135e4a7d981ba1417a8544f0d3afa6a1eb550 (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
{ stdenv, lib, fetchFromGitLab, pkg-config, libyamlcpp, libevdev }:

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

  src = fetchFromGitLab {
    owner = "interception/linux/plugins";
    repo = pname;
    rev = version;
    sha256 = "07hksca4g7v4zsvhmhc9j725j3n63fzrkx9sb4a0wrd7rwgr25rz";
  };

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ libevdev libyamlcpp ];

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

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

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