From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kMskDEE76WNBCwAAbAwnHQ (envelope-from ) for ; Sun, 12 Feb 2023 20:17:21 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QEMvDEE76WPVsAAAauVa8A (envelope-from ) for ; Sun, 12 Feb 2023 20:17:21 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E610DFF29 for ; Sun, 12 Feb 2023 20:17:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRHqT-0001Hl-Nf; Sun, 12 Feb 2023 14:17:05 -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 1pRHqR-0001HU-Dj for guix-patches@gnu.org; Sun, 12 Feb 2023 14:17:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRHqR-00030r-2i for guix-patches@gnu.org; Sun, 12 Feb 2023 14:17:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pRHqQ-0008BN-GB for guix-patches@gnu.org; Sun, 12 Feb 2023 14:17:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61458] [PATCH] services: xorg-wrapper: Support xorg server input Resent-From: Roman Scherer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 12 Feb 2023 19:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61458 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61458@debbugs.gnu.org X-Debbugs-Original-To: Guix Patches Received: via spool by submit@debbugs.gnu.org id=B.167622941031426 (code B ref -1); Sun, 12 Feb 2023 19:17:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Feb 2023 19:16:50 +0000 Received: from localhost ([127.0.0.1]:46779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRHqD-0008Am-Ih for submit@debbugs.gnu.org; Sun, 12 Feb 2023 14:16:49 -0500 Received: from lists.gnu.org ([209.51.188.17]:54880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRHqB-0008Ae-FW for submit@debbugs.gnu.org; Sun, 12 Feb 2023 14:16:48 -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 1pRHq9-0001GM-Ux for guix-patches@gnu.org; Sun, 12 Feb 2023 14:16:45 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRHq7-0002y8-Lo for guix-patches@gnu.org; Sun, 12 Feb 2023 14:16:45 -0500 Received: by mail-ej1-x632.google.com with SMTP id sb24so3110752ejb.8 for ; Sun, 12 Feb 2023 11:16:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burningswell-com.20210112.gappssmtp.com; s=20210112; h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc :subject:date:message-id:reply-to; bh=QCDCXi0iqJWNgDoV4cOhFKiyCk2s/AHQR/iEJhxzcBg=; b=MNNP4Ovj+wjdSB3Byp0wLhm7riDa3RIuVRBZLQPLSxgQRIunDzL3dNtC6o52A5gVL7 rwIv6XaIr0pfHwIE9UHnqhgDWG3kwhzKnw1PQio4lRKH9abOmOCEnO0KqCW1vhPViafX gtclpjYOOtjnWSJpami4yLI08xAYuMbhTX0d9Je51s42MTPZLf5r6WEjfLkPwK/dCAwO aA30QxqTwZlpTmE9FlJMYEy+yUQp2kCm4adZpdU6t/GmnoAnREc3BiW1PzNcIBcek9QN 4EY55zCcwCD/4ht8Mhn+i78OHLXe3jCEmn2uyBvaSBqmSqV2key/nBoMCnDAcSXOqZ7O lOKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QCDCXi0iqJWNgDoV4cOhFKiyCk2s/AHQR/iEJhxzcBg=; b=OcVIDy6ee4tvaxBIL+dBroC3oT82Pz5D45A33eC2iIiM/I+6W2rTFwhCwVbLiSzED+ DI5oY+/EFOA357WTuMDdZXjVFRt8lBy9ytcHl5UTpIA3K5AAnCwX4Of0ETgUe5rAiSoa P4Z3VcdQyVSJHcc1MNr5PPkY3QiWP8SrrK2JCr7Kv/eqPQAu43QNEPYTkd7nk6b38Ybt mdRhfbVPyYWFz6FM1w4T9jPyhvhZJHmgrJqW6qvUiom/rEk5Kc4grVmcNE87L496jHw5 xeCwDyto/uBwkjc91BeN0K3M9b6bfEdrfTUOrz0DuAmNmKreIRIJ0/j/ZC7N4zLfN6a3 fc8g== X-Gm-Message-State: AO0yUKUdwhcnG4NyXgSXh+6+OTsk0xau3InPZR8XyYY/iOWE6WE0wjca d/CdHaCk9UCCoEsrZF8Om/AFZAzof22f/t2q8Wk= X-Google-Smtp-Source: AK7set+SIe6WBWdor+TTgko6WNTFT+tZqf3zHTnot4zdP8jMRfWxDG9l/PlA8+yceYSRrQdyZG5VBw== X-Received: by 2002:a17:906:b202:b0:882:239e:23c0 with SMTP id p2-20020a170906b20200b00882239e23c0mr19263202ejz.12.1676229399976; Sun, 12 Feb 2023 11:16:39 -0800 (PST) Received: from bombaclaat ([2a01:598:b1b0:992:157d:949e:916b:98f2]) by smtp.gmail.com with ESMTPSA id r14-20020a170906364e00b0088351ea808bsm5676609ejb.46.2023.02.12.11.16.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Feb 2023 11:16:39 -0800 (PST) User-agent: mu4e 1.8.13; emacs 29.0.50 From: Roman Scherer Date: Sun, 12 Feb 2023 19:52:40 +0100 Message-ID: <86k00mvgmi.fsf@burningswell.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: none client-ip=2a00:1450:4864:20::632; envelope-from=roman.scherer@burningswell.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676229441; a=rsa-sha256; cv=none; b=Z/oaZ5QcJyCJjiQQ5lkv+e5/vWd7r3l9wX6l1isrdtoZIQQnPwFqPdbAXEoBnGjQZmJNfn GsXjjZyIKJOXEsVhVVeaz7yZjUzWAC7gVzXz+9+YPWPiRrGwUEo0fyOxwVbwxRlK9eC4lp KqblGaFmDYZZqj6+MylT9nF7Jiivef4i3zdwTbWtBhBl7ddvc+czqLV+2t6Ii1QDmpSVrP tg1B9gliDkc+2jheIYW2aaP7qFBBsaz15onAY2bqagdkYHPU2B27a5mF2uhVwIHKszb3O/ z2/pqnXGN6YPri4OVWlQR+fpynFHNvtxcLgx03KoKyNQjx9vP+8FtoJFVhIuNA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=burningswell-com.20210112.gappssmtp.com header.s=20210112 header.b=MNNP4Ovj; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676229441; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=QCDCXi0iqJWNgDoV4cOhFKiyCk2s/AHQR/iEJhxzcBg=; b=ZCoMb7pcj+yVPAcDySzFemis0TMh6bhov5y2YakmlMPhnYKCXRg1b5Hl2oGKh8CrouRKZV VVR748dE2AIIVIxMpoM+Yzj1OJx9gS3/I8CXf3664K1z+lKgqrxEVQRhXtPOBCZjYuW88X sRTCaywL0yOFyusxJ28CZcIRrOHUefTt6ugIJRL1qvqAbsG1W0XEZVlwTFgkXOCPJUWPh9 Ox3DW8GkR3Tjp1QLdPaIpDHYTVwZLNW+Q0OBnyGHFcwZm9vKAeLIQD6bc4M0LQum6c4kK4 08g6xP/GN17sjJ3tcx9uoetbYQi2J9y6ncLg6PHu0kCw20jvdxO7jmDOK66Bkg== X-Migadu-Queue-Id: E610DFF29 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=burningswell-com.20210112.gappssmtp.com header.s=20210112 header.b=MNNP4Ovj; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -4.92 X-Spam-Score: -4.92 X-TUID: rFw2I33EEVf3 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hello Guix, I would like to replace the Mesa package in my Xorg configuration. I tried to do this with the following snippet: ``` (modify-services %desktop-services (slim-service-type config => (slim-configuration (inherit config) (xorg-configuration (xorg-configuration (server (replace-mesa xorg-server))))))) ``` But this unfortunately does not work, because the xorg-wrapper uses static paths for the mesa, xkbcomp and xkeyboard-config packages in the derivation. The xserver starts now with the replaced mesa, but some paths still point to the hard coded packages in Guix itself (and not the replacement), which cause some things to not work. This patch changes this to lookup the paths from the inputs of the server field of the xorg-configuration instead. That way the correct paths are setup in the xor-wrapper script. If those inputs are not found for some reason it falls back to the current behavior, using the packages from Guix. Could you please review this? Thanks, Roman. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-services-xorg-wrapper-Support-xorg-server-input-tran.patch Content-Transfer-Encoding: quoted-printable From=20d035c99ed4703da0e3e9b62299c390560c074a17 Mon Sep 17 00:00:00 2001 From: r0man Date: Sat, 11 Feb 2023 19:36:16 +0100 Subject: [PATCH] services: xorg-wrapper: Support xorg server input transformations. * gnu/services/xorg.scm (xorg-wrapper): Support xorg server input transform= ations. =2D-- gnu/services/xorg.scm | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 5f073d05d3..92735e6004 100644 =2D-- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -355,6 +355,21 @@ (define files files) #t)))) =20 +(define (xorg-configuration-append-input config input default-input path) + (let ((server (xorg-configuration-server config))) + (file-append (or (lookup-package-direct-input server input) default-in= put) + path))) + +(define (xorg-configuration-dri-driver-path config) + (xorg-configuration-append-input config "mesa" mesa "/lib/dri")) + +(define (xorg-configuration-xkb-bin-dir config) + (xorg-configuration-append-input config "xkbcomp" xkbcomp "/bin")) + +(define (xorg-configuration-xkb-dir config) + (xorg-configuration-append-input config "xkeyboard-config" + xkeyboard-config "/share/X11/xkb")) + (define* (xorg-wrapper #:optional (config (xorg-configuration))) "Return a derivation that builds a script to start the X server with the given @var{config}. The resulting script should be used in place of @@ -362,12 +377,13 @@ (define* (xorg-wrapper #:optional (config (xorg-confi= guration))) (define exp ;; Write a small wrapper around the X server. #~(begin =2D (setenv "XORG_DRI_DRIVER_PATH" (string-append #$mesa "/lib/dri")) =2D (setenv "XKB_BINDIR" (string-append #$xkbcomp "/bin")) + (setenv "XORG_DRI_DRIVER_PATH" + #$(xorg-configuration-dri-driver-path config)) + (setenv "XKB_BINDIR" #$(xorg-configuration-xkb-bin-dir config)) =20 (let ((X (string-append #$(xorg-configuration-server config) "/bin= /X"))) (apply execl X X =2D "-xkbdir" (string-append #$xkeyboard-config "/share/X11= /xkb") + "-xkbdir" #$(xorg-configuration-xkb-dir config) "-config" #$(xorg-configuration->file config) "-configdir" #$(xorg-configuration-directory (xorg-configuration-modules config)) =2D-=20 2.38.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFTBAEBCAA9FiEE0iajOdjfRIFd3gygPdpSUn0qwZkFAmPpOxUfHHJvbWFuLnNj aGVyZXJAYnVybmluZ3N3ZWxsLmNvbQAKCRA92lJSfSrBmbUaB/9OdqZsRIF7ndO/ M/S0Xjglb4clxdKAwIPr42FLq2AFm8hAZbUNfWyNyEdG8JcIxOdhcmangDlyv9n7 CHFJuZBheVxHPQiJnm8/jOFmosnVtH9rtUE0p1iZ1ZJ+O7SMhF3dFZ/Dtr4y9Ssm ow+EIWp5/afeHFA9iLRfy6qcQ7I29A8N9f+bJs7NTDy6t0ThI0abTfTP1HPrtZkj PuZ4kCw7cyIaPu+Uu8xPWkpsfV24ZiE9sh9iZ336gQZrOEb9oVJ7lRCKladefw9W S/DJ5xNXOngU1PYrMPTbZ9r+/jxK5f8vuYqLLOr+cQoyuIcJtp97fjKraXjs/VBG lVcF8NlU =ppDt -----END PGP SIGNATURE----- --==-=-=--