depot/third_party/nixpkgs/pkgs/by-name/ni/niri/package.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

87 lines
1.8 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, libxkbcommon
, pango
, pipewire
, seatd
, stdenv
, wayland
, systemd
, libinput
, mesa
, fontconfig
, libglvnd
, autoPatchelfHook
, clang
}:
rustPlatform.buildRustPackage rec {
pname = "niri";
version = "0.1.6";
src = fetchFromGitHub {
owner = "YaLTeR";
repo = "niri";
rev = "v${version}";
hash = "sha256-MJh0CR2YHJE0GNnxaTcElNMuZUEI0pe9fvC0mfy4484=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"smithay-0.3.0" = "sha256-UzX5pws8yxJhXdKIDzu6uw+PlVLRS9U9ZAfQovKv0w0=";
};
};
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
autoPatchelfHook
clang
];
buildInputs = [
wayland
systemd # For libudev
seatd # For libseat
libxkbcommon
libinput
mesa # For libgbm
fontconfig
stdenv.cc.cc.lib
pipewire
pango
];
runtimeDependencies = [
wayland
mesa
libglvnd # For libEGL
];
passthru.providedSessions = ["niri"];
postPatch = ''
patchShebangs ./resources/niri-session
substituteInPlace ./resources/niri.service \
--replace-fail '/usr/bin' "$out/bin"
'';
postInstall = ''
install -Dm0755 ./resources/niri-session -t $out/bin
install -Dm0644 resources/niri.desktop -t $out/share/wayland-sessions
install -Dm0644 resources/niri-portals.conf -t $out/share/xdg-desktop-portal
install -Dm0644 resources/niri{-shutdown.target,.service} -t $out/share/systemd/user
'';
meta = with lib; {
description = "A scrollable-tiling Wayland compositor";
homepage = "https://github.com/YaLTeR/niri";
license = licenses.gpl3Only;
maintainers = with maintainers; [ iogamaster foo-dogsquared sodiboo ];
mainProgram = "niri";
platforms = platforms.linux;
};
}