@@ -0,0 +1,32 @@
1+{ lib, rustPlatform, fetchFromGitHub, x11, xorg, libpulseaudio, pkgconfig, patchelf }:
2+
3+rustPlatform.buildRustPackage rec {
4+ name = "xidlehook-${version}";
5+ version = "0.4.6";
6+
7+ src = fetchFromGitHub {
8+ owner = "jD91mZM2";
9+ repo = "xidlehook";
10+ rev = version;
11+
12+ sha256 = "0h84ichm1v2wdmm4w1n7jr70yfb9hhi7kykvd99ppg00h1x9lr7w";
13+ };
14+
15+ cargoSha256 = "0a1bl6fnfw6xy71q3b5zij52p9skylj1ivqj8my44bfsid2qfn7d";
16+
17+ buildInputs = [ x11 xorg.libXScrnSaver libpulseaudio ];
18+ nativeBuildInputs = [ pkgconfig patchelf ];
19+
20+ postFixup = ''
21+ RPATH="$(patchelf --print-rpath $out/bin/xidlehook)"
22+ patchelf --set-rpath "$RPATH:${libpulseaudio}/lib" $out/bin/xidlehook
23+ '';
24+
25+ meta = with lib; {
26+ description = "xautolock rewrite in Rust, with a few extra features";
27+ homepage = https://github.com/jD91mZM2/xidlehook;
28+ license = licenses.mit;
29+ maintainers = with maintainers; [ jD91mZM2 ];
30+ platforms = platforms.unix;
31+ };
32+}