summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Prikler <leo.prikler@student.tugraz.at>2020-10-31 17:46:03 +0100
committerGuix Patches Tester <>2020-10-31 16:58:09 +0000
commit86bdcdef54916de0e912acf8c12c59d3c5b5ed26 (patch)
tree161dab8097594ef2fc88ff183c9b56d8a0677452
parent9c69fec08e286f7486e64c2aa3110fa34974d15d (diff)
downloadguix-patches-86bdcdef54916de0e912acf8c12c59d3c5b5ed26.tar
guix-patches-86bdcdef54916de0e912acf8c12c59d3c5b5ed26.tar.gz
gnu: gnome-deskop-service-type: Set GUIX_GTK*_IM_MODULE_FILE.series-5616
This makes it, so that GNOME can handle system-wide input methods installed by adding them to the gnome package, to the operating system packages, or to some other profile-service. An example would be a system-wide installation of ibus along with input methods like ibus-anthy or ibus-rime. * gnu/services/desktop.scm (gnome-environment): New variable. (gnome-desktop-service-type)[extensions]: Use it here.
-rw-r--r--gnu/services/desktop.scm31
1 files changed, 31 insertions, 0 deletions
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 265cf9f35f..8a571aacb0 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -918,12 +918,43 @@ rules."
"gnome-system-monitor"
"gvfs"))))
+(define (gnome-environment config)
+ (let* ((lib "/run/current-system/profile/lib")
+ (im-module-files
+ `(("3"
+ "GUIX_GTK3_IM_MODULE_FILE"
+ .
+ ,(string-append lib "/gtk-3.0/3.0.0/immodules-gtk3.cache"))
+ ("2"
+ "GUIX_GTK2_IM_MODULE_FILE"
+ .
+ ,(string-append lib "/gtk-2.0/2.10.0/immodules-gtk2.cache"))))
+ (versions
+ (filter-map
+ (match-lambda
+ ((_ pkg)
+ (and (package? pkg)
+ (string=? (package-name pkg) "gtk+")
+ (version-major (package-version pkg))))
+ ((_ pkg "out")
+ (and (package? pkg)
+ (string=? (package-name pkg) "gtk+")
+ (version-major (package-version pkg))))
+ (_ #f))
+ (package-transitive-inputs (gnome-package config)))))
+ (filter-map
+ (lambda (version)
+ (assoc-ref im-module-files version))
+ (delete-duplicates versions))))
+
(define gnome-desktop-service-type
(service-type
(name 'gnome-desktop)
(extensions
(list (service-extension polkit-service-type
gnome-polkit-settings)
+ (service-extension session-environment-service-type
+ gnome-environment)
(service-extension profile-service-type
(compose list
gnome-package))))