(Keyboard-layout) form does not work "across the board"

  • Open
  • quality assurance status badge
Details
2 participants
  • o.rojon
  • Stefan Huchler
Owner
unassigned
Submitted by
o.rojon
Severity
normal
O
O
o.rojon wrote on 7 May 2020 09:01
(address . bug-guix@gnu.org)
7d29a1f07e7656f042551876ec6f2b44@posteo.net
Hej guys,

so I hope this actually is a bug and not something not yet implemented
or a misunderstanding on my part.

In the process of changing my login manager to slim (over gdm), I
noticed that the (keyboard-layout ...) form does not work the same way
in the (bootloader)/(set-xorg-configuration) and the
(slim-configuration) form. While in the former cases, (keyboard-layout
keyboard-layout) uses the string I inputted in the beginning of the
config file, an error is thrown when I try to do the same in the
(slim-configuration) form (error 1). When I simply use (service
slim-service-type) and try to supplement via (set-xorg-configuration),
an error is thrown as well (error 2).

Have a good day folks, guix rules :)

### The errors (with my shabby translations)
1) user@computer ~$ sudo guix system reconfigure
src/guix-config/os-desktop.scm
Passwort:
guix system: error: „src/guix-config/os-desktop.scm“ could not be
loaded: /home/user/src/guix-config/os-desktop.scm:68:30: Wrong type to
apply: #<<keyboard-layout> name: "de" variant: #f model: #f options: ()>

2) user@computer ~$ sudo guix system reconfigure
src/guix-config/os-desktop.scm
guix system: error: Der Dienst „xorg-server“ kommt mehr als einmal vor


### The config file (note that some parens might be unbalanced because I
tried to remove the "unnecessary" stuff)
(use-modules (gnu)
(srfi srfi-1))

(use-service-modules desktop networking ssh xorg)

(use-package-modules disk llvm linux ncdu xorg less gnome fonts
display-managers lxqt syncthing
version-control emacs emacs-xyz tex cups video gstreamer gnuzilla
web-browsers
messaging mail rsync suckless pdf curl databases hardware wm)

(operating-system
(locale "de_DE.utf8")
(timezone "Europe/Berlin")
(keyboard-layout (keyboard-layout "de"))
(host-name "computer")
(users (cons* (user-account
(name "user")
(comment "")
(group "users")
(home-directory "/home/hapster")
(supplementary-groups
'("wheel" "netdev" "audio" "video")))
%base-user-accounts))
(packages
(append
(map specification->package
'(
;;;; PACKAGES
))
%base-packages))

;;;; "alternative" Konfiguration
(services (cons* (service slim-service-type)
;; (slim-configuration
;; (xorg-configuration
;; (keyboard-layout keyboard-layout))))
;; (set-xorg-configuration
;; (xorg-configuration
;; (keyboard-layout keyboard-layout)))
(remove (lambda (service)
(eq? (service-kind service) gdm-service-type))
%desktop-services)))
(bootloader
(bootloader-configuration
(bootloader grub-bootloader)
(target "/dev/sdX")
(keyboard-layout keyboard-layout)))
(file-systems
(cons*
;;;; FILESYSTEMS
%base-file-systems)))
S
S
Stefan Huchler wrote on 24 May 2020 19:37
(address . bug-guix@gnu.org)
871rn9utch.fsf@mail.de
o.rojon@posteo.net writes:

Toggle quote (10 lines)
> In the process of changing my login manager to slim (over gdm), I
> noticed that the (keyboard-layout ...) form does not work the same way
> in the (bootloader)/(set-xorg-configuration) and the
> (slim-configuration) form. While in the former cases, (keyboard-layout
> keyboard-layout) uses the string I inputted in the beginning of the
> config file, an error is thrown when I try to do the same in the
> (slim-configuration) form (error 1). When I simply use (service
> slim-service-type) and try to supplement via (set-xorg-configuration),
> an error is thrown as well (error 2).

Hello "o",

sadly can't see your name, I run into the same Problem and first found
only your bug report so did not care to look for other bug reports
further back in the past, but this "bug" missunderstanding seems to be
related to bug#37422.

I found the solution by carefully reading the docu und try/error a few
iterations first with simpler level of config till I got the solution
( would be easier if I found the bug mentioned earlier but I learned more
this way so it's good :D )

This is the solution to get it working:
(service slim-service-type
(slim-configuration
(xorg-configuration (xorg-configuration
(keyboard-layout keyboard-layout)))))

The tricky part is that you have to use 2 times xorg-configuration one
time for the variable name and one time you have some sort of generator
function for xorg-configuration, that didn't clip for me as newcomer to
guix instantly.

If we consider that a bug it would be a documentian bug, and maybe that
the set-xorg-configuration method does not work (at least it seems that
way) that is not what the documentation implies. This function looks
like a general function where it says "e.g. gdm" that implies that it
should work for both gdm and all other login-managers the same way.

Ok just testet it that works to:

(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout)) slim-service-type)

Where the documentition there is missleading is that you see the:

Scheme Procedure: set-xorg-configuration config
[login-manager-service-type]

optional login-manager-service-type parameter but it's not described
that it defaults to gdm-service-type and can be therefor ommited in the
case of gdm.

So I would A maybe add more sample code and B adding (default:
gdm-service-type) behind the "set-xorg-configuration" description.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 41121@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 41121
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch