about summary refs log tree commit diff
path: root/pkgs/tools/X11/xidlehook/default.nix
blob: 733a8eb630ddb7baf1858d5a2b334bfb71d84af7 (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
33
{ lib, rustPlatform, fetchFromGitHub, x11, xorg, libpulseaudio, pkgconfig, patchelf
, stdenv}:

rustPlatform.buildRustPackage rec {
  name = "xidlehook-${version}";
  version = "0.4.6";

  src = fetchFromGitHub {
    owner = "jD91mZM2";
    repo = "xidlehook";
    rev = version;

    sha256 = "0h84ichm1v2wdmm4w1n7jr70yfb9hhi7kykvd99ppg00h1x9lr7w";
  };

  cargoSha256 = "0a1bl6fnfw6xy71q3b5zij52p9skylj1ivqj8my44bfsid2qfn7d";

  buildInputs = [ x11 xorg.libXScrnSaver libpulseaudio ];
  nativeBuildInputs = [ pkgconfig patchelf ];

  postFixup = lib.optionalString stdenv.isLinux ''
    RPATH="$(patchelf --print-rpath $out/bin/xidlehook)"
    patchelf --set-rpath "$RPATH:${libpulseaudio}/lib" $out/bin/xidlehook
  '';

  meta = with lib; {
    description = "xautolock rewrite in Rust, with a few extra features";
    homepage = https://github.com/jD91mZM2/xidlehook;
    license = licenses.mit;
    maintainers = with maintainers; [ jD91mZM2 ];
    platforms = platforms.unix;
  };
}