diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-03-22 18:02:20 +0000 |
|---|---|---|
| committer | Oleg Pykhalov <go.wigust@gmail.com> | 2026-04-03 18:03:13 +0300 |
| commit | c3a13b2593c8c03883ff2bd7b43812518396e1ea (patch) | |
| tree | a2aebebe4407813bd5fe753f66183d994c9403fd /gnu/home | |
| parent | 02c36a8ad87a4018d310fde26d5e0cd07fa7066b (diff) | |
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 <go.wigust@gmail.com>
Diffstat (limited to 'gnu/home')
| -rw-r--r-- | gnu/home/services/niri.scm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gnu/home/services/niri.scm b/gnu/home/services/niri.scm index edd6d73d72f..2ab53777c81 100644 --- a/gnu/home/services/niri.scm +++ b/gnu/home/services/niri.scm | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | (define-module (gnu home services niri) | 19 | (define-module (gnu home services niri) |
| 20 | #:use-module (gnu home services) | 20 | #:use-module (gnu home services) |
| 21 | #:use-module (gnu home services shepherd) | 21 | #:use-module (gnu home services shepherd) |
| 22 | #:use-module (gnu home services desktop) | ||
| 22 | #:use-module (gnu packages bash) | 23 | #:use-module (gnu packages bash) |
| 23 | #:use-module (gnu packages freedesktop) | 24 | #:use-module (gnu packages freedesktop) |
| 24 | #:use-module (gnu packages glib) | 25 | #:use-module (gnu packages glib) |
| @@ -40,14 +41,15 @@ | |||
| 40 | 41 | ||
| 41 | (define (home-niri-shepherd-service config) | 42 | (define (home-niri-shepherd-service config) |
| 42 | "Return a shepherd service that runs Niri, a scrollable tiling Wayland | 43 | "Return a shepherd service that runs Niri, a scrollable tiling Wayland |
| 43 | compositor. The service starts Niri in a DBus session with appropriate | 44 | compositor. The service starts Niri with appropriate environment variables |
| 44 | environment variables set for a Wayland desktop session." | 45 | set for a Wayland desktop session." |
| 45 | (list (shepherd-service | 46 | (list (shepherd-service |
| 46 | (documentation "Run Niri scrollable tiling Wayland compositor.") | 47 | (documentation "Run Niri scrollable tiling Wayland compositor.") |
| 47 | (provision '(niri)) | 48 | (provision '(niri)) |
| 49 | (requirement '(dbus)) | ||
| 48 | (start #~(make-forkexec-constructor | 50 | (start #~(make-forkexec-constructor |
| 49 | (list #$(file-append bash "/bin/bash") "-l" | 51 | (list #$(file-append bash "/bin/bash") "-l" |
| 50 | "-c" "exec dbus-run-session niri --session") | 52 | "-c" "exec niri --session") |
| 51 | #:environment-variables | 53 | #:environment-variables |
| 52 | (append (list #$@(niri-configuration-environment-variables config)) | 54 | (append (list #$@(niri-configuration-environment-variables config)) |
| 53 | '("DESKTOP_SESSION=niri" | 55 | '("DESKTOP_SESSION=niri" |
| @@ -66,6 +68,8 @@ environment variables set for a Wayland desktop session." | |||
| 66 | (extensions | 68 | (extensions |
| 67 | (list (service-extension home-shepherd-service-type | 69 | (list (service-extension home-shepherd-service-type |
| 68 | home-niri-shepherd-service) | 70 | home-niri-shepherd-service) |
| 71 | (service-extension home-dbus-service-type | ||
| 72 | (const '())) | ||
| 69 | (service-extension home-profile-service-type | 73 | (service-extension home-profile-service-type |
| 70 | (lambda (config) | 74 | (lambda (config) |
| 71 | (list dbus | 75 | (list dbus |
