nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config,
6 libxkbcommon,
7 python3,
8 runCommand,
9 wprs,
10}:
11rustPlatform.buildRustPackage {
12 pname = "wprs";
13 version = "0-unstable-2025-09-05";
14
15 src = fetchFromGitHub {
16 owner = "wayland-transpositor";
17 repo = "wprs";
18 rev = "1eb482e0f80cc84a3ee55f7cda99df9bea6573af";
19 hash = "sha256-+m0gXQQa2NkUFNXfGPCwHTlyTFOw1nfjrUBgSD5iGMo=";
20 };
21
22 nativeBuildInputs = [
23 pkg-config
24 ];
25
26 buildInputs = [
27 libxkbcommon
28 (python3.withPackages (pp: with pp; [ psutil ]))
29 ];
30
31 cargoHash = "sha256-krrVgdoCcW3voSiQAoWsG+rPf1HYKbuGhplhn21as2c=";
32
33 env.RUSTFLAGS = "-C target-feature=+avx2"; # only works on x86 systems supporting AVX2
34
35 preFixup = ''
36 cp wprs "$out/bin/wprs"
37 '';
38
39 passthru.tests.sanity = runCommand "wprs-sanity" { nativeBuildInputs = [ wprs ]; } ''
40 ${wprs}/bin/wprs -h > /dev/null && touch $out
41 '';
42
43 meta = {
44 description = "Rootless remote desktop access for remote Wayland";
45 license = lib.licenses.asl20;
46 maintainers = with lib.maintainers; [ mksafavi ];
47 platforms = [ "x86_64-linux" ]; # The aarch64-linux support is not implemented in upstream yet. Also, the darwin platform is not supported as it requires wayland.
48 homepage = "https://github.com/wayland-transpositor/wprs";
49 mainProgram = "wprs";
50 };
51}