nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 curl,
7 libICE,
8 libSM,
9 libX11,
10 libXdmcp,
11 libXext,
12 libXinerama,
13 libXrandr,
14 libXtst,
15 libei,
16 libportal,
17 openssl,
18 pkgsStatic,
19 pkg-config,
20 qt6,
21 wrapGAppsHook3,
22 avahi,
23 avahi' ? avahi.override { withLibdnssdCompat = true; },
24 withLibei ? !stdenv.hostPlatform.isDarwin,
25}:
26stdenv.mkDerivation (finalAttrs: {
27 pname = "input-leap";
28 version = "3.0.3";
29
30 src = fetchFromGitHub {
31 owner = "input-leap";
32 repo = "input-leap";
33 rev = "v${finalAttrs.version}";
34 hash = "sha256-zSaeeMlhpWIX3y4OmZ7eHXCu1HPP7NU5HFkME/JZjuQ=";
35 fetchSubmodules = true;
36 };
37
38 patches = [ ./macos-no-dmg.patch ];
39
40 nativeBuildInputs = [
41 pkg-config
42 cmake
43 wrapGAppsHook3
44 qt6.wrapQtAppsHook
45 qt6.qttools
46 ];
47
48 buildInputs = [
49 curl
50 qt6.qtbase
51 avahi'
52 libX11
53 libXext
54 libXtst
55 libXinerama
56 libXrandr
57 libXdmcp
58 libICE
59 libSM
60 ]
61 ++ lib.optionals withLibei [
62 libei
63 libportal
64 ]
65 ++ lib.optionals stdenv.hostPlatform.isDarwin [
66 pkgsStatic.openssl
67 ];
68
69 cmakeFlags = [
70 "-DINPUTLEAP_REVISION=${builtins.substring 0 8 finalAttrs.src.rev}"
71 ]
72 ++ lib.optional withLibei "-DINPUTLEAP_BUILD_LIBEI=ON";
73
74 dontWrapGApps = true;
75 preFixup = ''
76 qtWrapperArgs+=(
77 "''${gappsWrapperArgs[@]}"
78 --prefix PATH : "${lib.makeBinPath [ openssl ]}"
79 )
80 '';
81
82 meta = {
83 description = "Open-source KVM software";
84 longDescription = ''
85 Input Leap is software that mimics the functionality of a KVM switch, which historically
86 would allow you to use a single keyboard and mouse to control multiple computers by
87 physically turning a dial on the box to switch the machine you're controlling at any
88 given moment. Input Leap does this in software, allowing you to tell it which machine
89 to control by moving your mouse to the edge of the screen, or by using a keypress
90 to switch focus to a different system.
91 '';
92 homepage = "https://github.com/input-leap/input-leap";
93 license = lib.licenses.gpl2Plus;
94 maintainers = with lib.maintainers; [
95 phryneas
96 twey
97 shymega
98 ];
99 platforms = lib.platforms.linux ++ lib.platforms.darwin;
100 };
101})