nixpkgs/pkgs/by-name/ni/niri/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

132 lines
3.2 KiB
Nix
Raw Normal View History

2024-10-08 04:27:41 +00:00
{
lib,
clang,
dbus,
eudev,
2024-10-08 04:27:41 +00:00
fetchFromGitHub,
libdisplay-info,
libglvnd,
libinput,
2024-10-08 04:27:41 +00:00
libxkbcommon,
mesa,
nix-update-script,
2024-10-08 04:27:41 +00:00
pango,
pipewire,
pkg-config,
rustPlatform,
2024-10-08 04:27:41 +00:00
seatd,
systemd,
wayland,
withDbus ? true,
withDinit ? false,
withScreencastSupport ? true,
withSystemd ? true,
}:
rustPlatform.buildRustPackage rec {
pname = "niri";
2024-11-14 09:39:05 +00:00
version = "0.1.10.1";
src = fetchFromGitHub {
owner = "YaLTeR";
repo = "niri";
rev = "refs/tags/v${version}";
2024-11-14 09:39:05 +00:00
hash = "sha256-Qjf7alRbPPERfiZsM9EMKX+HwjESky1tieh5PJIkLwE=";
};
postPatch = ''
patchShebangs resources/niri-session
substituteInPlace resources/niri.service \
--replace-fail '/usr/bin' "$out/bin"
'';
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
2024-11-10 19:20:49 +00:00
"libspa-0.8.0" = "sha256-kp5x5QhmgEqCrt7xDRfMFGoTK5IXOuvW2yOW02B8Ftk=";
2024-11-14 09:39:05 +00:00
"smithay-0.3.0" = "sha256-nSM7LukWHO2n2eWz5ipFNkTCYDvx/VvPXnKVngJFU0U=";
};
};
strictDeps = true;
nativeBuildInputs = [
clang
pkg-config
rustPlatform.bindgenHook
];
buildInputs =
[
libdisplay-info
libglvnd # For libEGL
libinput
libxkbcommon
mesa # For libgbm
pango
seatd
wayland # For libwayland-client
]
++ lib.optional (withDbus || withScreencastSupport || withSystemd) dbus
++ lib.optional withScreencastSupport pipewire
++ lib.optional withSystemd systemd # Includes libudev
++ lib.optional (!withSystemd) eudev; # Use an alternative libudev implementation when building w/o systemd
buildFeatures =
lib.optional withDbus "dbus"
++ lib.optional withDinit "dinit"
++ lib.optional withScreencastSupport "xdp-gnome-screencast"
++ lib.optional withSystemd "systemd";
buildNoDefaultFeatures = true;
postInstall =
''
install -Dm0644 resources/niri.desktop -t $out/share/wayland-sessions
''
+ lib.optionalString withDbus ''
install -Dm0644 resources/niri-portals.conf -t $out/share/xdg-desktop-portal
''
2024-11-10 19:41:05 +00:00
+ lib.optionalString (withSystemd || withDinit) ''
install -Dm0755 resources/niri-session -t $out/bin
2024-11-10 19:41:05 +00:00
''
+ lib.optionalString withSystemd ''
install -Dm0644 resources/niri{-shutdown.target,.service} -t $out/lib/systemd/user
2024-11-10 19:41:05 +00:00
''
+ lib.optionalString withDinit ''
install -Dm0644 resources/dinit/niri{-shutdown,} -t $out/lib/dinit.d/user
'';
env = {
# Force linking with libEGL and libwayland-client
# so they can be discovered by `dlopen()`
RUSTFLAGS = toString (
map (arg: "-C link-arg=" + arg) [
"-Wl,--push-state,--no-as-needed"
"-lEGL"
"-lwayland-client"
"-Wl,--pop-state"
]
);
};
passthru = {
providedSessions = [ "niri" ];
updateScript = nix-update-script { };
};
2024-07-03 19:59:58 +00:00
meta = {
description = "Scrollable-tiling Wayland compositor";
homepage = "https://github.com/YaLTeR/niri";
2024-10-08 04:39:32 +00:00
changelog = "https://github.com/YaLTeR/niri/releases/tag/v${version}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
2024-10-08 04:27:41 +00:00
iogamaster
foo-dogsquared
sodiboo
2024-10-08 04:53:44 +00:00
getchoo
2024-10-08 04:27:41 +00:00
];
mainProgram = "niri";
platforms = lib.platforms.linux;
};
}