GNU bug report logs -
#67314
xorg-configuration's extra-config should support file-like objects
Previous Next
To reply to this bug, email your comments to 67314 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guix <at> gnu.org
:
bug#67314
; Package
guix
.
(Mon, 20 Nov 2023 23:41:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ian Eure <ian <at> retrospec.tv>
:
New bug report received and forwarded. Copy sent to
bug-guix <at> gnu.org
.
(Mon, 20 Nov 2023 23:41:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
I needed to tweak some xorg settings (set scroll direction, enable
tearfree, etc). On other distros, this is done by dropping files
of
config snippets into /etc/xorg.conf.d.
On Guix, this needs to be done through the extra-config field of
the
xorg-configuration record. That field requires a list of strings,
which
means the configurations need to be inlined into the config, which
is
verbose and unsightly.
For example:
(operating-system
(services
(append (list (service openssh-service-type)
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout)
(extra-config
(list
"Section \"InputClass\"
Identifier \"Touchpads\"
MatchIsTouchpad \"on\"
Driver \"libinput\"
Option \"ClickMethod\" \"clickfinger\"
Option \"DisableWhileTyping\" \"on\"
Option \"NaturalScrolling\" \"on\"
Option \"Tapping\" \"off\"
EndSection"))))))))
The manual states that extra-config takes "a list of strings or
objects," but doesn’t indicate what type of object is expected.
If I
pass a file-like object, like this:
(operating-system
(services
(append (list (service openssh-service-type)
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout)
(extra-config
(list (local-file
"xorg/touchpads.conf")))))))))
The resulting Xorg configutation has the store paths for those
files
added to it, instead of their contents. This is an invalid
configuation, rendering Xorg unable to start.
I was able to split the difference by reading the file contents
into the
config, ala:
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout)
(extra-config
(map (lambda (file)
(call-with-port (open-file (string-append "xorg/"
file ".conf") "r") get-string-all))
'("radeon" "elecom-huge" "trackpad")))))
But this feels like a graceless hack to me.
The situation would be drastically simplified if extra-config
supported
file-like objects.
This bug report was last modified 1 year and 71 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.