From c3a13b2593c8c03883ff2bd7b43812518396e1ea Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Sun, 22 Mar 2026 18:02:20 +0000 Subject: [PATCH] home: services: niri: Use existing session dbus. Spawning niri with `dbus-run-session` as is done here causes the compositor and children applications to run within it's own D-Bus session bus rather than relying on the already existing one. This causes Guix home services that rely on a session bus to misbehave within a niri session, as the bus the services are talking to is not the same as the one niri & applications see. Guix home already provides a `home-dbus-service-type` for ensuring a D-Bus session bus exists, so it makes sense to just rely on that. * gnu/home/services/niri.scm (home-niri-service-type): Add HOME-DBUS-SERVICE-TYPE extension. (home-niri-shepherd-service)[requirement]: Add DBUS requirement. [start]: Drop the 'dbus-run-session' call in favour of extending HOME-DBUS-SERVICE-TYPE. Change-Id: I1d402064128fe94aaaa2868e174752ef640dd31e Signed-off-by: Oleg Pykhalov --- gnu/home/services/niri.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gnu/home/services/niri.scm b/gnu/home/services/niri.scm index edd6d73d72..2ab53777c8 100644 --- a/gnu/home/services/niri.scm +++ b/gnu/home/services/niri.scm @@ -19,6 +19,7 @@ (define-module (gnu home services niri) #:use-module (gnu home services) #:use-module (gnu home services shepherd) + #:use-module (gnu home services desktop) #:use-module (gnu packages bash) #:use-module (gnu packages freedesktop) #:use-module (gnu packages glib) @@ -40,14 +41,15 @@ (define (home-niri-shepherd-service config) "Return a shepherd service that runs Niri, a scrollable tiling Wayland -compositor. The service starts Niri in a DBus session with appropriate -environment variables set for a Wayland desktop session." +compositor. The service starts Niri with appropriate environment variables +set for a Wayland desktop session." (list (shepherd-service (documentation "Run Niri scrollable tiling Wayland compositor.") (provision '(niri)) + (requirement '(dbus)) (start #~(make-forkexec-constructor (list #$(file-append bash "/bin/bash") "-l" - "-c" "exec dbus-run-session niri --session") + "-c" "exec niri --session") #:environment-variables (append (list #$@(niri-configuration-environment-variables config)) '("DESKTOP_SESSION=niri" @@ -66,6 +68,8 @@ environment variables set for a Wayland desktop session." (extensions (list (service-extension home-shepherd-service-type home-niri-shepherd-service) + (service-extension home-dbus-service-type + (const '())) (service-extension home-profile-service-type (lambda (config) (list dbus