From unknown Sat Jun 21 10:34:44 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#59983] [PATCH] home: Let user configure XDG base directories. Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Mon, 12 Dec 2022 03:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59983 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59983@debbugs.gnu.org Cc: Antero Mejr , ludo@gnu.org X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: ludo@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167081409025775 (code B ref -1); Mon, 12 Dec 2022 03:02:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Dec 2022 03:01:30 +0000 Received: from localhost ([127.0.0.1]:49803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4Z4M-0006hf-7Y for submit@debbugs.gnu.org; Sun, 11 Dec 2022 22:01:30 -0500 Received: from lists.gnu.org ([209.51.188.17]:56714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4Z4K-0006hZ-OD for submit@debbugs.gnu.org; Sun, 11 Dec 2022 22:01: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 1p4Z4F-0002pR-9L for guix-patches@gnu.org; Sun, 11 Dec 2022 22:01:28 -0500 Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1p4Z4C-00081s-Cs for guix-patches@gnu.org; Sun, 11 Dec 2022 22:01:22 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4NVmbq5yjgz9sNY for ; Mon, 12 Dec 2022 04:01:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1670814071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=aZ2xl2oADxz9PHLPcELvKloVIqFDGCUI6gCV/ny3SFQ=; b=PGzXQV4rG5kOb7qDCDAbOPLejTmLux5O8CR7HeXu0OjAvbfI87oBq07wZVOa99NrJmzhzU mtepoB3DLkiS5V5PDipD4pS1QQGtB7JR0PNwsAT+DTDBbKvzkTOov/6w/d81a9QHcpbHge Nk/eDlMd/ctWFaBxGW/EMtJ7Pnq4bMkJEnOQezUKSu4NpL1xV1S/4Bsbh4a1KuMu8WbE/Y BDxpF9WRnPHuhN6qr/Lna0SeIg3hdkBj4OMzE9OGwlkeKb+fDq65G6Iw1O+CmlycUFI8wW w8xR3ZvLSJHTFmxwqLtpgVHHctL3JVSxA2UQorjrN6Phxd4qmHpRdvOnCjcklA== From: Antero Mejr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1670814067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=aZ2xl2oADxz9PHLPcELvKloVIqFDGCUI6gCV/ny3SFQ=; b=jqgwiPa/HdLGj0HO/KQn/mQT4+ParFda62rYOIU37PomZvsSYGN2UsQEH4FVfLjdf6FPzm FmFMzyM1vNtv1JvI8T3psBVNh20Rkfjb9ijILiCWmH4LcI3kA7uuSYAtntkJHbKZegYIHT XFv68BjcCFmSdp42VTV1N/ZqusU1zjI0lhjID3KEhKDxjJaaVl0+wv0dzmMpULDwYYjRfA HqlNcQC0Nsgx7BEc1tpwLyfL8m91io8pEhVWLOiFs991IegqtnDF/uFla9bOiDhAQGqAoE elQgqVpFybZ6/Ih1fkNq7W6VoRmkU4d2183bnQTWLkcczFlsLLATJq2oqXWdKQ== Date: Mon, 12 Dec 2022 03:00:49 +0000 Message-Id: <20221212030049.4725-1-antero@mailbox.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MBO-RS-META: 5tsq4bqg6acy3o8zus67bdf8imbcq6zr X-MBO-RS-ID: de8c7fb73d939f0086c X-Rspamd-Queue-Id: 4NVmbq5yjgz9sNY Received-SPF: pass client-ip=2001:67c:2050:0:465::201; envelope-from=antero@mailbox.org; helo=mout-p-201.mailbox.org 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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: -2.3 (--) * gnu/home.scm (home-environment)[base-xdg-configuration]: New field. * gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation): Make XDG_RUNTIME_DIR directory if the configuration changes it from the default. --- Allows making a runtime dir at ~/.local/runtime (or any other dir), so users don't have to set up elogind or other greeters/PAM modules. gnu/home.scm | 9 +++++++-- gnu/home/services/xdg.scm | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gnu/home.scm b/gnu/home.scm index c95d1e0818..f100b575e3 100644 --- a/gnu/home.scm +++ b/gnu/home.scm @@ -39,6 +39,7 @@ (define-module (gnu home) home-environment-essential-services home-environment-services home-environment-location + home-environment-base-xdg-configuration home-environment-with-provenance @@ -71,7 +72,10 @@ (define-record-type* home-environment (location home-environment-location ; (default (and=> (current-source-location) source-properties->location)) - (innate))) + (innate)) + + (base-xdg-configuration home-environment-base-xdg-configuration + (default (home-xdg-base-directories-configuration)))) (define (home-environment-default-essential-services he) "Return the list of essential services for home environment." @@ -83,7 +87,8 @@ (define (home-environment-default-essential-services he) (service home-symlink-manager-service-type) (service home-fontconfig-service-type) - (service home-xdg-base-directories-service-type) + (service home-xdg-base-directories-service-type + (home-environment-base-xdg-configuration he)) (service home-shell-profile-service-type) (service home-service-type) diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm index 865f8b81d7..b62580461e 100644 --- a/gnu/home/services/xdg.scm +++ b/gnu/home/services/xdg.scm @@ -133,7 +133,12 @@ (define (ensure-xdg-base-dirs-on-activation config) (configuration-field-name field) 'upper)))) ;; XDG_RUNTIME_DIR shouldn't be created during activation ;; and will be provided by elogind or other service. - (and (not (string=? "XDG_RUNTIME_DIR" variable)) + ;; But if the user changes the value from the default, + ;; then we can make XDG_RUNTIME_DIR. + (and (or (not (string=? "XDG_RUNTIME_DIR" variable)) + (not (string=? ((configuration-field-getter field) + config) + "${XDG_RUNTIME_DIR:-/run/user/$UID}"))) variable))) home-xdg-base-directories-configuration-fields))) -- 2.38.1 From unknown Sat Jun 21 10:34:44 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#59983] [PATCH] home: Let user configure XDG base directories. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Dec 2022 04:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59983 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59983@debbugs.gnu.org Cc: ludo@gnu.org, Antero Mejr X-Debbugs-Original-To: Antero Mejr via Guix-patches via , 59983@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167090553317577 (code B ref -1); Tue, 13 Dec 2022 04:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Dec 2022 04:25:33 +0000 Received: from localhost ([127.0.0.1]:57681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4wrE-0004ZR-Uh for submit@debbugs.gnu.org; Mon, 12 Dec 2022 23:25:33 -0500 Received: from lists.gnu.org ([209.51.188.17]:55790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4wrA-0004ZE-NJ for submit@debbugs.gnu.org; Mon, 12 Dec 2022 23:25: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 1p4wrA-0008OO-7L for guix-patches@gnu.org; Mon, 12 Dec 2022 23:25:28 -0500 Received: from relay11.mail.gandi.net ([2001:4b98:dc4:8::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4wr8-0003Bw-Bp; Mon, 12 Dec 2022 23:25:27 -0500 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 74735100004; Tue, 13 Dec 2022 04:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1670905521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ezu/O+jjtbW4VOl6mdzYTGLNQKHJGzetDiIYvKx3Vw0=; b=WA3fvl4B+/oAiJlPirZeGHvsw0lUZnLjm2XZF959zWXabqJlR2OTz9wC65ENQ2HJ7ylNqf Hzuwm4zacLeQh8z/KjXT+S2+diTamOG+B4eU8GXhB/kmXyz4rfrbdph0o05egL4pl2LjXK XyEoRsFQ5CP6bqd+ndmW+rxionceoyA2ocOC1p/MPJ8PPlXUpPjkGuJcjE2q7qa96n3+JH CyxMloyWD3CrCOxQ9WnWZOEczuFX2RsXSfdxANsxFuHGiyuwVaQUCl9iDOuIk2GOy57R0d T3hEQTKHRqv1Jz3k2lvfulr8h7MoGcZwW91eUyOwBd31C5MdIElA5pOHGeBhHA== From: Andrew Tropin In-Reply-To: <20221212030049.4725-1-antero@mailbox.org> References: <20221212030049.4725-1-antero@mailbox.org> Date: Tue, 13 Dec 2022 08:25:16 +0400 Message-ID: <87cz8o9bgz.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2001:4b98:dc4:8::231; envelope-from=andrew@trop.in; helo=relay11.mail.gandi.net 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) 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: -2.6 (--) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2022-12-12 03:00, Antero Mejr via Guix-patches via wrote: > * gnu/home.scm (home-environment)[base-xdg-configuration]: New field. > * gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation): Make > XDG_RUNTIME_DIR directory if the configuration changes it from the defaul= t. > --- > Allows making a runtime dir at ~/.local/runtime (or any other dir), > so users don't have to set up elogind or other greeters/PAM modules. > > gnu/home.scm | 9 +++++++-- > gnu/home/services/xdg.scm | 7 ++++++- > 2 files changed, 13 insertions(+), 3 deletions(-) > > diff --git a/gnu/home.scm b/gnu/home.scm > index c95d1e0818..f100b575e3 100644 > --- a/gnu/home.scm > +++ b/gnu/home.scm > @@ -39,6 +39,7 @@ (define-module (gnu home) > home-environment-essential-services > home-environment-services > home-environment-location > + home-environment-base-xdg-configuration >=20=20 > home-environment-with-provenance >=20=20 > @@ -71,7 +72,10 @@ (define-record-type* home-environme= nt > (location home-environment-location ; > (default (and=3D> (current-source-location) > source-properties->location)) > - (innate))) > + (innate)) > + > + (base-xdg-configuration home-environment-base-xdg-configuration > + (default (home-xdg-base-directories-configurat= ion)))) >=20=20 > (define (home-environment-default-essential-services he) > "Return the list of essential services for home environment." > @@ -83,7 +87,8 @@ (define (home-environment-default-essential-services he) > (service home-symlink-manager-service-type) >=20=20 > (service home-fontconfig-service-type) > - (service home-xdg-base-directories-service-type) > + (service home-xdg-base-directories-service-type > + (home-environment-base-xdg-configuration he)) This change is not needed, you can set xdg dirs by extending home-xdg-base-directories-service-type with adjusted home-xdg-base-directories-configuration. > (service home-shell-profile-service-type) >=20=20 > (service home-service-type) > diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm > index 865f8b81d7..b62580461e 100644 > --- a/gnu/home/services/xdg.scm > +++ b/gnu/home/services/xdg.scm > @@ -133,7 +133,12 @@ (define (ensure-xdg-base-dirs-on-activation config) > (configuration-field-name field) 'upper)))) > ;; XDG_RUNTIME_DIR shouldn't be created during activati= on > ;; and will be provided by elogind or other service. > - (and (not (string=3D? "XDG_RUNTIME_DIR" variable)) > + ;; But if the user changes the value from the default, > + ;; then we can make XDG_RUNTIME_DIR. > + (and (or (not (string=3D? "XDG_RUNTIME_DIR" variable)) > + (not (string=3D? ((configuration-field-getter = field) > + config) > + "${XDG_RUNTIME_DIR:-/run/user/$= UID}"))) > variable))) > home-xdg-base-directories-configuration-fields))) There is no way to understand upfront if directory containing XDG_RUNTIME_DIR is writable and this is why it's a good idea to delegate initialization of it to external thing and never try to create it here, even if it has non-default value. But in case you are sure it's writable and want to ensure the directory created, just be this thing managing and providing XDG_RUNTIME_DIR and extend activation script with the following G-expression: #~(mkdir-p (getenv "XDG_RUNTIME_DIR")) The full snippet: =2D-8<---------------cut here---------------start------------->8--- (simple-service 'ensure-xdg-runtime-dir-exists home-activation-service-type #~(mkdir-p (getenv "XDG_RUNTIME_DIR"))) =2D-8<---------------cut here---------------end--------------->8--- =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmOX/qwACgkQIgjSCVjB 3rD81hAAkSvQI5SzFQT9K2+R7cnwgOYC6dNwbLgwpj6iaH2mTOalp4wXTMdyz7e+ 5z0qC07nIcKHdLYtqjnSRU3d9sRhXTAoxvBx62OWNx2EPes0lDK2h+OLBPTF5qoF wrH9JfryfmflT37dGf5A5dKr9yBumJapcQbmEWPQoy6/72gqbei1XHcneIpjz3uc WzHadbW7nSGi8BOQIIyIoztK9ZLEiaAjnr4V83wyo/q8/TVgrR4D8KU9aF2oIURI Y5T//8eyXV6cfHLM3U3J6KWx4m6NC+0SOsP/y9Xjg8WjugdjGVW22BHBGeB/Fz+H x9qkQdZTTw/g9MqYK2iTA/QcxArsOf+y8D4mVFe/d7tLRDCf4lu5YGcAwY0IwGtb Ei77a3vPzTQzkr69Ve4RvfqFSdjxDmj+KMSgvWAaX7zp9c8Iw4vz+xxIMBBIrXHb Kt+5vGaZK9PI2u10t8mu9jx+DItuy1t2nXSe6lf0JlEnIktKb2FvkNwHrqQbpZgh vBNYXY7uGtmij+Vg3oRMi5EuujQHkjtqYZPg8InPR97MscMDH1lPPJSgS/RaINS8 PQdTjFbGKP8CbCPqwidrXtLFEmi71t1jnv5a2dbZKUmNhyQW1ARMe8KvDmGVFCaY 4tyQhyOMqUnO4Lh5sLjOGuCLZ8xmnQUX/nHHfYCfLW9xWgtcpYY= =wELh -----END PGP SIGNATURE----- --=-=-=-- From unknown Sat Jun 21 10:34:44 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#59983] [PATCH] home: Let user configure XDG base directories. Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Dec 2022 16:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59983 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Andrew Tropin Cc: ludo@gnu.org, antero@mailbox.org, 59983@debbugs.gnu.org X-Debbugs-Original-Cc: ludo@gnu.org, Antero Mejr , Antero Mejr via Guix-patches via , 59983@debbugs.gnu.org Received: via spool by 59983-submit@debbugs.gnu.org id=B59983.167094785622147 (code B ref 59983); Tue, 13 Dec 2022 16:11:01 +0000 Received: (at 59983) by debbugs.gnu.org; 13 Dec 2022 16:10:56 +0000 Received: from localhost ([127.0.0.1]:33047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p57rr-0005l9-J7 for submit@debbugs.gnu.org; Tue, 13 Dec 2022 11:10:55 -0500 Received: from mout-p-103.mailbox.org ([80.241.56.161]:40576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p57rp-0005kk-DU for 59983@debbugs.gnu.org; Tue, 13 Dec 2022 11:10:54 -0500 Received: from smtp2.mailbox.org (unknown [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4NWk4L011lz9sWX; Tue, 13 Dec 2022 17:10:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1670947842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QBkXSU1S9n9Oh8Fe5AvZAUJva/PUMk6OE4UKo4ZonP8=; b=Q7/Ubw8pEbCWITOnEJbKXiAQqVqtMNXWXIBoKPC+h/FuJTtumo+f1tKmJ29YmFIrdpnK0r rWBf+e335++aAZy5NyDUKwZ8xrj2RKlJEMdHaoIYhQSSsfFnWfSiLhVx3zH0sB8dbqhqwv +KhMCWRQI3Q9o9EUa+21Rlv+RQbwseT/tMjIzP2OP7AtPA30G0xdsyM2SXVYXKW1LcNLt9 ZNLkxjj1YtNICtVzLYfDvO9mBIBLUV+LZ4+du3NjNnRp0J2aL9oWAjVXWxr8H7GyYVj0y4 4vvRrMmU3X6tHGxP5tOjwk6OmUj7lPk4m7msSyhldLVE0Ow6T0n4G/KXpZTI6w== References: <20221212030049.4725-1-antero@mailbox.org> <87cz8o9bgz.fsf@trop.in> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1670947837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QBkXSU1S9n9Oh8Fe5AvZAUJva/PUMk6OE4UKo4ZonP8=; b=ITu1KOgOyk61xjwDzNhlu3fl7v+NPyOjStleSPx6bU7Nvuyedcioc8dMADqs6zBSymUp/A 0JnJU30zK0k0obm1dr3caNaVefxCNTvcAQrHMsrWB3WSsjGeWHi2wt5tZyf/iSLBPO2ZjJ VIRttp8Ql2LbNiXXMgNIj5NX/Vz08nbYdQr4SGmgp+FYVFkyHu0NW/7AsIQZU0r8q+fio9 uF74tnTquDKlR5TFCi0xbnPI/p0AYiWwHSMyJDiRHZQ2AS1e3Z+VsuMUAvMNeEtcITaOfl TsTDwwPP2TH7sOa8tvGkSvc+4Y6UeY9K4/PNKqLFJqaFbiSNUvjT0B22tIuoDQ== From: Antero Mejr Date: Tue, 13 Dec 2022 15:53:23 +0000 In-reply-to: <87cz8o9bgz.fsf@trop.in> Message-ID: <87y1rbthce.fsf@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain X-MBO-RS-ID: 850fe4be9cebad7cccf X-MBO-RS-META: sicw3i91jy391si6ts9ygk7miah8w1er X-Spam-Score: -0.7 (/) 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: -1.7 (-) Andrew Tropin writes: > There is no way to understand upfront if directory containing > XDG_RUNTIME_DIR is writable and this is why it's a good idea to delegate > initialization of it to external thing and never try to create it here, > even if it has non-default value. Thank you for the snippet, that's a much better way of fixing my issue. I still think guix home should (by default) be able to use all its features without the requirement of having external programs installed. For example, suppose you have a server that you want to set up your home environment on, for when you login to do sysadmin tasks. That server wouldn't have %desktop-services (elogind), nor would it have a custom greeter like greetd. So XDG_RUNTIME_DIR will be unset. If XDG_RUNTIME_DIR does not exist, can we make a fallback path to have guix home put the shepherd socket and on-first-login-executed flag file in ~/.local/var/run (or somewhere else writable) instead? From unknown Sat Jun 21 10:34:44 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#59983] [PATCH] home: Let user configure XDG base directories. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Aug 2023 06:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59983 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Antero Mejr Cc: ludo@gnu.org, antero@mailbox.org, 59983@debbugs.gnu.org X-Debbugs-Original-Cc: ludo@gnu.org, Antero Mejr , Antero Mejr via Guix-patches via , 59983@debbugs.gnu.org Received: via spool by 59983-submit@debbugs.gnu.org id=B59983.169139147315571 (code B ref 59983); Mon, 07 Aug 2023 06:58:01 +0000 Received: (at 59983) by debbugs.gnu.org; 7 Aug 2023 06:57:53 +0000 Received: from localhost ([127.0.0.1]:60438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSuBd-000432-3U for submit@debbugs.gnu.org; Mon, 07 Aug 2023 02:57:53 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:50419) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qSuBa-00042k-72 for 59983@debbugs.gnu.org; Mon, 07 Aug 2023 02:57:52 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id AF0BBE0003; Mon, 7 Aug 2023 06:57:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1691391462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FZrE1IjWFHZDQo3q9+7i08Hes2zi6bOFmCH16ZRpePY=; b=pe7meGkojHP4CnDZJdPPCcV6HHX8VdRXpHRlLL3aJfwDiz6d0vQnKUP4hCfJr2VAb01cK7 zrAKDi8Zkl1DqXYH9Pimg76K3Yc0Ej0rXmCwSxeISemJO3h9HluUffzwcwbWj/d0avfEMD xMMD724kxIra23ACg4cmxvShBnkhmCnS1K3CjC/SjztinxxJk+9cLv3bd3B1cCYqSPz/3j HMK2hkEYPsFI78nTgmJpWAHOvzHuEYUrsetx6R7nrRP9O2pNLeb5Mn1nbwLCJxg5joXx+W NukMFwtQltPBU4M3qtgQWYmTkXgoqJzjByTrUiYL9qcaNPO4UHNYsBNoihMeUA== From: Andrew Tropin In-Reply-To: <87y1rbthce.fsf@mailbox.org> References: <20221212030049.4725-1-antero@mailbox.org> <87cz8o9bgz.fsf@trop.in> <87y1rbthce.fsf@mailbox.org> Date: Mon, 07 Aug 2023 10:57:37 +0400 Message-ID: <87350vl4pq.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-GND-Sasl: andrew@trop.in X-Spam-Score: -0.7 (/) 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: -1.7 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2022-12-13 15:53, Antero Mejr wrote: > Andrew Tropin writes: >> There is no way to understand upfront if directory containing >> XDG_RUNTIME_DIR is writable and this is why it's a good idea to delegate >> initialization of it to external thing and never try to create it here, >> even if it has non-default value. > > Thank you for the snippet, that's a much better way of fixing my issue. > > I still think guix home should (by default) be able to use all its > features without the requirement of having external programs installed. > > For example, suppose you have a server that you want to set up your home > environment on, for when you login to do sysadmin tasks. That server > wouldn't have %desktop-services (elogind), nor would it have a custom > greeter like greetd. So XDG_RUNTIME_DIR will be unset. > > If XDG_RUNTIME_DIR does not exist, can we make a fallback path to have > guix home put the shepherd socket and on-first-login-executed flag file > in ~/.local/var/run (or somewhere else writable) instead? Without automatic cleanup (which is the case for elogind, pam_rundir and other options providing XDG_RUNTIME_DIR) it will likely missbehave. It's much trickier than it seems on the first sight. Theoretically it's possible, but requires a lot of additional work to do it right. In fact on-first-login script is a kinda hack to make shepherd started somehow, but running user's shepherd is tricky on its own. Shutting it down correctly (and all the processes managed by it) is even more challenging. AFAIK, there is no easy and straightforward solution (even in other init systems that we can quickly borrow), so it will require time and effort to carefully design and implement it. If you want to work on it - send you ideas, research and patches for the possible solutions, I'll share my input :) =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmTQleEACgkQIgjSCVjB 3rDqyA/+Ifuvgo/hUJbOO/h3HV9DocSM4vg7VWybqB4wpv7/CeJ0VFg+55rxwTwH Zyd9s+uo5++C5t2ausObDGG69PuFUY0Pksnb9kWIntw2R045O85LbbXEW1lYBQuV u0yE/u80RhgJcx2cg9pfY8+rrPd+47Jkag4gWcb8ccgARLTnTbu+2/4w3DuzkM65 hynWQKr0zku2o5e33I7+Zks96KJDApMpP54Vhunl8W9wtRJfsiLUygmzFuEA2IGG TMrNXBRJdAhyZpeBEpFcrtc3Qa8+1OHSg/UmGd9OmCfLYneA4IuN51qaDmZ4LjLU sWiQdjW4BXQhhWg44wz+NwDNFBMK7jBHZ+/42Yh1ArQWJ61av3XnhjvBVyVrQPFw vAZFfNAUgLBLSKHWs9fXF05NuIJLf3cWl+DS/3g7Aq8N29sH/1OeEw/F9PIvuDoX XaqostVLGlAiTnyMkpUeHnzQsRYTZg7+fA8Qhtj2Jva6/fTvWvckXcJhjCd+RLck dZrcIgkU3kqBxioCKwwNNJ70VAffPqH8iDDMwptGIjDrJnI+sQz/gH0mCqx6Zepj urG9kvZRnw3+KiSe2QnhEaWP8zGyfiaqTV43xL3MkxVZmwFywrkurM9QEMQKg3oC FEoRU7OHn5kKXhULZOz1a2alWOZnGPLr/mnb0vXOf29gnQcxtEI= =gdmK -----END PGP SIGNATURE----- --=-=-=--