nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 rustPlatform,
5 fetchFromGitHub,
6 makeWrapper,
7 dbus,
8 ffmpeg,
9 x264,
10 libva,
11 gst_all_1,
12 libxv,
13 libxtst,
14 libxrender,
15 libxrandr,
16 libxi,
17 libxinerama,
18 libxft,
19 libxfixes,
20 libxext,
21 libxcursor,
22 libxcomposite,
23 libdrm,
24 pkg-config,
25 pango,
26 pipewire,
27 cmake,
28 git,
29 autoconf,
30 libtool,
31 typescript,
32 wayland,
33 libxkbcommon,
34}:
35
36rustPlatform.buildRustPackage {
37 pname = "weylus";
38 version = "unstable-2025-10-08";
39
40 src = fetchFromGitHub {
41 owner = "H-M-H";
42 repo = "weylus";
43 rev = "56e29ecbde3a4aba994a9df047b5398feb447c1b";
44 hash = "sha256-dHdgWrygSXqKf9fpYRVDj+Ql97Or/kjBfN/mECy2ipc=";
45 };
46
47 buildInputs = [
48 ffmpeg
49 x264
50 ]
51 ++ lib.optionals stdenv.hostPlatform.isLinux [
52 dbus
53 libva
54 gst_all_1.gst-plugins-base
55 libxext
56 libxft
57 libxinerama
58 libxcursor
59 libxrender
60 libxfixes
61 libxtst
62 libxrandr
63 libxcomposite
64 libxi
65 libxv
66 pango
67 libdrm
68 wayland
69 libxkbcommon
70 ];
71
72 nativeBuildInputs = [
73 cmake
74 git
75 typescript
76 makeWrapper
77 ]
78 ++ lib.optionals stdenv.hostPlatform.isLinux [
79 pkg-config
80 autoconf
81 libtool
82 ];
83
84 cargoHash = "sha256-Mx8/zMG36qztbFYgqC7SB75bf8T0NkYQA+2Hs9/pnjk=";
85
86 cargoBuildFlags = [ "--features=ffmpeg-system" ];
87 cargoTestFlags = [ "--features=ffmpeg-system" ];
88
89 postFixup =
90 let
91 GST_PLUGIN_PATH = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" [
92 gst_all_1.gst-plugins-base
93 pipewire
94 ];
95 in
96 lib.optionalString stdenv.hostPlatform.isLinux ''
97 wrapProgram $out/bin/weylus --prefix GST_PLUGIN_PATH : ${GST_PLUGIN_PATH}
98 '';
99
100 postInstall = ''
101 install -vDm755 weylus.desktop $out/share/applications/weylus.desktop
102 '';
103
104 env = {
105 NIX_CFLAGS_COMPILE = toString [
106 "-Wno-incompatible-pointer-types"
107 ];
108 };
109
110 meta = {
111 description = "Use your tablet as graphic tablet/touch screen on your computer";
112 mainProgram = "weylus";
113 homepage = "https://github.com/H-M-H/Weylus";
114 license = with lib.licenses; [ agpl3Only ];
115 maintainers = [ ];
116 };
117}