Subject: Re: bug#39606: Keyboard layout defined by 'set-xorg-configuration' is not honored by GDM.
From: Maxim Cournoyer <[email-masked]>
To: [email-masked]
Date: Thu, 22 Oct 2020 15:54:19 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello!

I'm happy to report this was due to mis-configuration on my part.  More
specifically, it it was missing the xorg-configuration modification bit,
which is documented.  Testing in a VM using the following, modified
configuration cannot reproduce the problem:

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/system/examples/lightweight-desktop.tmpl b/gnu/system/examples/lightweight-desktop.tmpl
index d5a63dc457..42e7891641 100644
--- a/gnu/system/examples/lightweight-desktop.tmpl
+++ b/gnu/system/examples/lightweight-desktop.tmpl
@@ -3,7 +3,7 @@
 ;; environments.
 
 (use-modules (gnu) (gnu system nss))
-(use-service-modules desktop)
+(use-service-modules desktop xorg)
 (use-package-modules bootloaders certs emacs emacs-xyz ratpoison suckless wm
                      xorg)
 
@@ -11,12 +11,14 @@
   (host-name "antelope")
   (timezone "Europe/Paris")
   (locale "en_US.utf8")
+  (keyboard-layout (keyboard-layout "jp"))
 
   ;; Use the UEFI variant of GRUB with the EFI System
   ;; Partition mounted on /boot/efi.
   (bootloader (bootloader-configuration
-                (bootloader grub-efi-bootloader)
-                (target "/boot/efi")))
+               (bootloader grub-efi-bootloader)
+               (target "/boot/efi")
+               (keyboard-layout keyboard-layout)))
 
   ;; Assume the target root file system is labelled "my-root",
   ;; and the EFI System Partition has UUID 1234-ABCD.
@@ -53,7 +55,10 @@
 
   ;; Use the "desktop" services, which include the X11
   ;; log-in service, networking with NetworkManager, and more.
-  (services %desktop-services)
+  (services (cons (set-xorg-configuration
+                   (xorg-configuration  ;for Xorg
+                    (keyboard-layout keyboard-layout)))
+                  %desktop-services))
 
   ;; Allow resolution of '.local' host names with mDNS.
   (name-service-switch %mdns-host-lookup-nss))
--8<---------------cut here---------------end--------------->8---

Closing :-)

Maxim