Emacs on Niri - not launching like it once did in GNOME

I switched from GNOME to Niri and now, through the launcher items “Emacs” and “Emacs (Client)”, it doesn’t open, and I don’t see anything at all.

I have enabled and disabled services.emacs.enable and it seems to make no difference.

What is different? How can I launch it?

Relevant configurations snippets

NixOS configuration regarding Emacs as a service:

# Start the Emacs service on startup.

{}: {
  services.emacs.enable = true;
}

My NixOS configuration module for Niri:

# Niri is a “scrollable” window manager written in Rust.

{ pkgs, ... }: {
  programs.niri.enable = true;

  # Enable polkit, a go-between that lets unprivileged processes communicate
  # with privileged ones.
  security.polkit.enable = true;

  # GNOME Keyring is a key unlocking and password entry GUI.
  services.gnome.gnome-keyring.enable = true;

  # Enable the default PAM module for swaylock, a lightweight Wayland lock
  # screen.
  security.pam.services.swaylock = {};

  # Waybar is a lightweight customizable top bar for Wayland.
  programs.waybar.enable = true;

  # Install packages globally so that they can be used for multiple users.
  environment.systemPackages = with pkgs; [
    # Install packages in the default configuration.
    alacritty
    fuzzel
    swaylock
    mako
    swayidle
  ];
}

The package definition for Emacs:

# These are packages for Emacs and the configuration frameworks within.
{ pkgs, ... }: {
  home.packages =
    builtins.attrValues {
      inherit (pkgs)
        # These are the dependencies for Doom Emacs.
        git
        ripgrep
        coreutils
        fd
        clang
        # nerd-fonts.symbols-only

        emacs;
    };
}

Version information

  • NixOS freshly upgraded to 25.11
  • niri –version says niri 25.11 (Nixpkgs)
  • Emacs version 30.2
1 Like

Since you’re using the emacs service, you have to inspect its behavior with systemctl --user status emacs.

In my experience issues like this are usually caused by seesion init problems; I imagine the server launches, and is open in the background, but fails to open windows - most likely because you’re forgetting to import vars into systemd as part of your init scripts. This is just conjecture, though :slight_smile:

It may be an issue between xorg and wayland. By default niri does not support X11 apps (you need to install xwayland-satellite for that) so you can switch emacs with emacs-pgtk (which handles wayland quite nicely).

1 Like

That was precisely the solution, using emacs-pgt. Thank you so much.