zaphyra's git: nixfiles

zaphyra's nixfiles

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 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
57 
{
  lib,
  rustPlatform,
  fetchFromGitHub,
  makeWrapper,
  pkg-config,
  dbus,
  libpulseaudio,
  libxkbcommon,
  wayland,
  ...
}:

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "librepods";
  version = "0.0.0";
  cargoHash = "sha256-17dE+oYvECU4f1SL6LHS95sXEea/Z0VgTPQ4u6TZTic=";

  src =
    (fetchFromGitHub {
      owner = "kavishdevar";
      repo = finalAttrs.pname;
      hash = "sha256-EuIYvBqBtpgutVqPOLIO3E9OhVzQ5q5TDoz/F+9MHEE=";
      rev = "linux/rust";
    })
    + "/linux-rust";

  nativeBuildInputs = [
    pkg-config
    makeWrapper
  ];

  buildInputs = [
    dbus
    libpulseaudio
    libxkbcommon
    wayland
  ];

  postFixup = ''
    for executable in $(find $out/bin -type f -executable); do
      wrapProgram $executable \
        --prefix LD_LIBRARY_PATH : ${
          lib.makeLibraryPath [
            wayland
            libxkbcommon
          ]
        }
    done
  '';

  meta = {
    mainProgram = "librepods";
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [ zaphyra ];
  };
})