diff --git a/pkgs/niri/default.nix b/pkgs/niri/default.nix index b9955c22..0da93afb 100644 --- a/pkgs/niri/default.nix +++ b/pkgs/niri/default.nix @@ -4,14 +4,17 @@ , pkg-config , pipewire , udev -, clang -, libclang , libxkbcommon , libinput , systemd , wayland , mesa , seatd + +# Session script dependencies. +, makeBinaryWrapper +, coreutils +, dbus }: rustPlatform.buildRustPackage rec { @@ -26,12 +29,12 @@ rustPlatform.buildRustPackage rec { }; nativeBuildInputs = [ + makeBinaryWrapper pkg-config - clang + rustPlatform.bindgenHook ]; buildInputs = [ - libclang.lib libinput libxkbcommon mesa @@ -42,19 +45,32 @@ rustPlatform.buildRustPackage rec { wayland ]; - env.LIBCLANG_PATH = "${libclang.lib}/lib"; - cargoLock = { - lockFile = ./Cargo.lock; + lockFile = "${src}/Cargo.lock"; outputHashes = { "smithay-0.3.0" = "sha256-Eqs4wqogdld6MHOXQ2NRFCgJH4RHf4mYWFdjRVUVxsk="; }; }; + postPatch = '' + patchShebangs ./resources/niri-session + ''; + + postInstall = '' + install -Dm0755 resources/niri-session -t $out/libexec + makeWrapper $out/libexec/niri-session \ + --prefix PATH ':' '${lib.makeBinPath [ coreutils systemd dbus ]}' + + install -Dm0644 resources/niri.desktop -t $out/share/applications + install -Dm0644 resources/niri-portals.conf -t $out/share/xdg-desktop-portal + install -Dm0644 resources/niri{-shutdown.target,.service} -t $out/share/systemd + ''; + meta = with lib; { homepage = "https://github.com/YaLTeR/niri"; description = "Scrollable tiling window manager"; license = licenses.gpl3Plus; + mainProgram = "niri"; maintainers = with maintainers; [ foo-dogsquared ]; platforms = platforms.linux; };