From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 20 18:40:31 2023 Received: (at submit) by debbugs.gnu.org; 20 Nov 2023 23:40:31 +0000 Received: from localhost ([127.0.0.1]:54836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5DsU-0002z9-V5 for submit@debbugs.gnu.org; Mon, 20 Nov 2023 18:40:31 -0500 Received: from lists.gnu.org ([2001:470:142::17]:49532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5DsS-0002yw-PN for submit@debbugs.gnu.org; Mon, 20 Nov 2023 18:40:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5DsK-0003eh-OD for bug-guix@gnu.org; Mon, 20 Nov 2023 18:40:20 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5DsI-0005Uf-25 for bug-guix@gnu.org; Mon, 20 Nov 2023 18:40:20 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 45FFB5C128C for ; Mon, 20 Nov 2023 18:40:15 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 20 Nov 2023 18:40:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to; s=fm3; t=1700523615; x=1700610015; bh=A/ 3ayOKTalnPpSrVCjZJ0b/xxRmqAdwKkoHlvLNk28A=; b=FXDcdiMZAp4awa6nu0 3mdPWHw8T96CiZt+LpF+8VpJMgm0qxDDQyV+cFI2ATTyMa3hoEv8W2EjfFOSmBYs W90R2SHTUTufGVn/UYvzL8HtEC0FVpp11fCMGywyfH/NtqpDFFBbcNT4jitY2CoI ZfPA+4gjoRraDp6ISSgUY5y+d56FtxDFk1YJNjtsN5a6Fg5Q12lwd0WUfcuIXpru kB+6TiyV/IOW7UWyH3YiVH5jXWI7bU+GDrmAvVHcak+zJDpdBEiNvbjtc3Jbsyxy 026WbrJTdTPFIlyd5yPkYsW3dsq+jyFghbGugvt6syLcPOOlMi9Hb27ZGfwEgcsj yZpQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1700523615; x=1700610015; bh=A/3ayOKTalnPp SrVCjZJ0b/xxRmqAdwKkoHlvLNk28A=; b=yPYs/x9kBm7J4WO4Cy6qMgvVbvEmT HXn6Sk6fKhBE2AMrwI5+tGEIzByYLMU/a8vvFVyWbm5AWHtPHkUvUwDL8xTToByf +v3NZp4EO7SdUC+Abh3RjhPhkhicAMiCLhU7fqgDL/FO2oQRdA9HEYG7BxpR9Eri b1kQqBi+I7jsu9LJI2f/njvwHBTxnnZxbsuXuLFRzWLr8W/j/E2Vx7Gi8vD0fIKn BaIg6e94DQoaTYEs/Qdms2XPK2tyhfFRBnX1F93+9c0TmMCHvcmSRShTagerFqlJ 6yOkZWg8fcJ6YDg1lhbdFYmBSV9t2dNbk3nJlbIKztNkp4R5gHkxEte2w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudegkedgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegfhffvufffkfggtgfgsehtqhertd dtreejnecuhfhrohhmpefkrghnucfguhhrvgcuoehirghnsehrvghtrhhoshhpvggtrdht vheqnecuggftrfgrthhtvghrnhepkeeigeegfffhlefhgfeiffevjeejhedvjeffieeife eiteelveduueeljeehheejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepihgrnhesrhgvthhrohhsphgvtgdrthhv X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 20 Nov 2023 18:40:14 -0500 (EST) User-agent: mu4e 1.10.7; emacs 29.1 From: Ian Eure To: bug-guix@gnu.org Subject: xorg-configuration's extra-config should support file-like objects Date: Mon, 20 Nov 2023 15:33:17 -0800 Message-ID: <87ttpg804j.fsf@retrospec.tv> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=66.111.4.28; envelope-from=ian@retrospec.tv; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) I needed to tweak some xorg settings (set scroll direction, enable tearfree, etc). On other distros, this is done by dropping files=20 of config snippets into /etc/xorg.conf.d. On Guix, this needs to be done through the extra-config field of=20 the xorg-configuration record. That field requires a list of strings,=20 which means the configurations need to be inlined into the config, which=20 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=E2=80=99t indicate what type of object is expected.=20 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=20 "xorg/touchpads.conf"))))))))) The resulting Xorg configutation has the store paths for those=20 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=20 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/"=20 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=20 supported file-like objects.