Nix: run Niri on RPI 5

Hello everyone,

I am attempting to get niri running on my Raspberry Pi5 4GB. Unfortunately, it is not working properly.

The operating system on the Rpi is Raspbian with nothing but a package manager.

I installed the following packages via a Flake:

niriWindowManager = pkgs.buildInputs {
  name = "niri window manager";
  paths = with pkgs; [
    alacritty
    dms
    nautilus
    niri
    waybar
    fuzzel
    gdm
    swaylock
    sway
    wayland
    wayland-utils
    libxkbcommon
    libinput
    pixman
    mesa
    xwayland
    libxkbcommon
    libpulseaudio
    libxcb
  ];
};

The installation runs smoothly. However, when I start niri via the console, I get the following error message. Does anyone know what the problem could be, or does it work in general?

niri
2025-12-15T11:46:39.3506232 INFO niri: starting version 25.11 (Ellipsis)
2025-12-15T11:46:39.4223892 INFO niri_config: loaded config from "/home/user/.config/niri/config.kdl"

thread 'main' (758) panicked at src/main.rs:881:5:
called `Result::unwrap()` on an `Err` value: DirectCreationError { line: 89, file: "/build/niri-25.11-windowsysinit-0.30.12/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(ConnectFailed(ConnectIon(Or))) }}}
stack backtrace:
  0: rust_panic::begin_unwind
  1: core::panicking::panic_fmt
  2: core::result::unwrap_failed
  3: niri::main
note: Some details are omitted. Run with `RUST_BACKTRACE=full` for a verbose backtrace.

Thanks :slight_smile:

i dunno if that snippet like came from an LLM, but invoking the separate package sounds like non-idiomatic usage to me.
the nixos wiki does have an article on niri - does that help?
for what it’s worth, that presumes using nixos on the rpi, rather than just nix the package manager.

1 Like

On my desktop I run niri with nixos, which works great. For the Rpi , I wanted to try the nix Paketmanager without nixos, to See how it works and performs in a non nixos distribution.

The many pakages was a attempt, if the issue was a missing package.

Even if you get it running, running a graphical application such as Niri on non-NixOS with the nix package is going to give you headaches as the graphics libraries they use do not match.

Better to build into directly on Raspbian or run NixOS on the Pi (it’s great)

Agreed, the graphics libraries are going to be the issue. A solution might be nixGL, but I’ve not tried i on a pi or with niri so I can’t fully comment other than it exists and may solve the issue.