From unknown Mon Aug 18 11:12:42 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#59474 <59474@debbugs.gnu.org> To: bug#59474 <59474@debbugs.gnu.org> Subject: Status: Guix Home generated .profile sets XDG_ vars that break GDM+Gnome login on foreign distros Reply-To: bug#59474 <59474@debbugs.gnu.org> Date: Mon, 18 Aug 2025 18:12:42 +0000 retitle 59474 Guix Home generated .profile sets XDG_ vars that break GDM+Gn= ome login on foreign distros reassign 59474 guix submitter 59474 Matt Armstrong severity 59474 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 22 01:02:25 2022 Received: (at submit) by debbugs.gnu.org; 22 Nov 2022 06:02:25 +0000 Received: from localhost ([127.0.0.1]:49458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxMMS-0005Ij-Ur for submit@debbugs.gnu.org; Tue, 22 Nov 2022 01:02:25 -0500 Received: from lists.gnu.org ([209.51.188.17]:45678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxMMN-0005IX-UD for submit@debbugs.gnu.org; Tue, 22 Nov 2022 01:02:23 -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 1oxMMN-0007e2-MW for bug-guix@gnu.org; Tue, 22 Nov 2022 01:02:19 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxMML-0002ks-4d for bug-guix@gnu.org; Tue, 22 Nov 2022 01:02:19 -0500 Received: (Authenticated sender: matt@rfc20.org) by mail.gandi.net (Postfix) with ESMTPSA id 456EBE000A for ; Tue, 22 Nov 2022 06:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rfc20.org; s=gm1; t=1669096931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=dWfNBaI7QXaBCfeO7y7XUnWqr+kEPvdfai+ldKEMXZY=; b=R1jSBTE23oBLTTwpRvkr3fludl63WdG2Dy46QwrNAqOaiUqC9uuC+toDYI0fCBA7vyW72H l5ogg7++KflM1dFQIiXC063CNUEFuJdikZ5f84AYmNWgyhARvdq/Cpiu9uJTNbzT27sXnG e40HwwNz6RZn5uGPD9HGmxlBkpYjggPQGewlGpPaleNsI6Wi88KoHjJu9rgwW8I9oKps3K c7CRgF3g53bPU3q3krlKh5rJph77x8YmJNB9zWJbDeTclHg+FlJ5SPjJ30KGuMhgysUTRL tVYPSDaH4Jlt5f+F4MsKMdEbc7pfrY6Lm14NLLOfBfC4gISeiuf4wqrgfJv4hg== Received: by mac-mini.lan (Postfix) with ESMTPS id 22C6F3A361 for ; Mon, 21 Nov 2022 22:02:08 -0800 (PST) Received: by naz.lan (Postfix, from userid 1000) id 019C643BF200; Mon, 21 Nov 2022 22:02:07 -0800 (PST) From: Matt Armstrong To: bug-guix@gnu.org Subject: Guix Home generated .profile sets XDG_ vars that break GDM+Gnome login on foreign distros Date: Mon, 21 Nov 2022 22:02:07 -0800 Message-ID: <87fsebbk80.fsf@rfc20.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.196; envelope-from=matt@rfc20.org; helo=relay4-d.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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-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: -2.6 (--) I am experimenting with Guix Home on Debian Testing, using GDM+Gnome. The .profile generated by "guix home reconfigure" broke logging in to the Gnome desktop. The gnome session would die, failing to initialize what it considered to be essential things, and return to the login screen I could log in to a tty, and was able to undo the new .profile and get back to a working system. The home-configuration.scm I used was generated by "guix home import" and was quite simple: ---------------------------------------------------------------------- (use-modules (gnu home) (gnu packages) (gnu services) (guix gexp) (gnu home services shells)) (home-environment ;; Below is the list of packages that will show up in your ;; Home profile, under ~/.guix-home/profile. (packages (specifications->packages (list "glibc-locales"))) ;; Below is the list of Home services. To search for available ;; services, run 'guix home search KEYWORD' in a terminal. (services (list (service home-bash-service-type (home-bash-configuration (aliases '(("ls" . "ls --color=auto"))) (bashrc (list (local-file ".bashrc" "bashrc"))) (bash-logout (list (local-file ".bash_logout" "bash_logout")))))))) ---------------------------------------------------------------------- Note: a stock GDM+Gnome setup runs the user's login shell when logging in via the GDM display manager, and this shell execs gnome-session-binary. This doesn't necessarily happen with other display managers or other desktop environments, so on those systems the Guix Home .profile may not even run before the DE is initialized. Nearly all of my time debugging this was spent figuring this out! :-) The .profile file generated by Guix Home is this: ---------------------------------------------------------------------- HOME_ENVIRONMENT=$HOME/.guix-home . $HOME_ENVIRONMENT/setup-environment $HOME_ENVIRONMENT/on-first-login ---------------------------------------------------------------------- The first thing I see is that $HOME/.guix-home/seutp-environment is modifying various XDG_ variables incorrectly. It prepends new values without honor the variable's default value if it doesn't happen to be set already. For example, if XDG_DATA_DIRS is not set its default value is "/usr/local/share/:/usr/share/". But .guix-home/setup-environment will instead prepend a value without checking, leaving XDG_DATA_DIRS set incorrectly to "$HOME/.guix-home/profile/share:" when it should be "$HOME/.guix-home/profile/share:/usr/local/share/:/usr/share/". See this code in setup-environment: case $XDG_DATA_DIRS in *$HOME_ENVIRONMENT/profile/share*) ;; *) export XDG_DATA_DIRS=$HOME_ENVIRONMENT/profile/share:$XDG_DATA_DIRS ;; esac The correct idiom is this: XDG_DATA_DIRS=PATH_TO_PREPEND:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/} or XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}:PATH_TO_APPEND The above is what I see in various Nix and Snap configuration files. Because I have a few other things installed that modify XDG_DATA_DIRS before Guix Home does, Guix Home doesn't break that particular variable. It did break XDG_CONFIG_DIRS, since Guix Home was setting it to "$HOME/.guix-home/profile/etc/xdg:". I worked around this problem by running this code before Guix Home's .profile: # Note: when XDG_CONFIG_DIRS is not set Guix home sets # XDG_CONFIG_DIRS="$HOME/.guix-home/profile/etc/xdg:", which removes # the default "/etc/xdg" value. if [[ -z $XDG_CONFIG_DIRS ]]; then XDG_CONFIG_DIRS=/etc/xdg fi # Note: when XDG_DATA_DIRS is not set Guix home sets # XDG_DATA_DIRS="$HOME/.guix-home/profile/share:", which removes the # default "/usr/local/share:/usr/share" value. if [[ -z $XDG_DATA_DIRS ]]; then XDG_DATA_DIRS="/usr/local/share:/usr/share" fi I have other more minor quibbles about how Guix Home handles XDG values: XDG_STATE_HOME is set to a non-standard value. In the current XDG Base Directory Specification it defaults to "$HOME/.local/state", but Guix Home sets it to "$HOME/.local/var/lib". On a foreign distro this is going to cause some disruption when a user switches to Guix Home, or switches away. XDG_LOG_HOME is a non-standard variable. The spec suggests that logs should go in XDG_STATE_HOME. Why not a establish a GUIX_LOG_HOME variable instead? (if it ever does become a standard XDG variable, its default may not be the same one picked by Guix Home, causing the same issue as above). Setting XDG_RUNTIME_DIR is not something I would expect Guix Home to do -- it is the job of whatever logs the user in. XDG_CACHE_HOME, XDG_CONFIG_HOME, XDG_DATA_HOME are set to their defaults unnecessarily. I modified my personal config by unsetting XDG_STATE_HOME, XDG_LOG_HOME, XDG_CACHE_HOME, XDG_CONFIG_HOME, and XDG_DATA_HOME if Guix Home left them set to their default values (in the case of XDG_STATE_HOME I unset it unconditionally). From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 22 02:09:55 2022 Received: (at 59474) by debbugs.gnu.org; 22 Nov 2022 07:09:55 +0000 Received: from localhost ([127.0.0.1]:49521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxNPn-0007C9-3z for submit@debbugs.gnu.org; Tue, 22 Nov 2022 02:09:55 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:19158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxNPk-0007Bw-E7 for 59474@debbugs.gnu.org; Tue, 22 Nov 2022 02:09:53 -0500 Received: from lprikler-laptop.ist.intra (gw.ist.tugraz.at [129.27.202.101]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4NGb3w4TY4z1LZ3L for <59474@debbugs.gnu.org>; Tue, 22 Nov 2022 08:09:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4NGb3w4TY4z1LZ3L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1669100988; bh=+Mg9TBzKn01pm44Q2eqXtlcZWf8JRtnG8srWiYdDMM8=; h=Subject:From:To:Date:In-Reply-To:References:From; b=LLIxihvm7uIvPR3uo4vkW0sG4HoUq8cF7c7ZxldeFcyfRTTnxOTNha1dl1OJ0hBQ+ c7Htcf3hrSKPBkOujzMw8kOIM6Ke3/QiYzD15FjKZtXRXYqi3jyj6ebfVtFqG89T5f ASHMA5ZJCBVFE0YufpP5jhlRcwzWrec1OHcYLZ7Y= Message-ID: Subject: Re: Guix Home generated .profile sets XDG_ vars that break GDM+Gnome login on foreign distros From: Liliana Marie Prikler To: 59474@debbugs.gnu.org Date: Tue, 22 Nov 2022 08:09:47 +0100 In-Reply-To: <87fsebbk80.fsf@rfc20.org> References: <87fsebbk80.fsf@rfc20.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.0 MIME-Version: 1.0 X-TUG-Backscatter-control: waObeELIUl4ypBWmcn/8wQ X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -0.4 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59474 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: -3.3 (---) Am Montag, dem 21.11.2022 um 22:02 -0800 schrieb Matt Armstrong: > The first thing I see is that $HOME/.guix-home/seutp-environment is > modifying various XDG_ variables incorrectly.=C2=A0 It prepends new value= s > without honor the variable's default value if it doesn't happen to be > set already. This is a known problem with Debian. Unlike Ubuntu, which relies on Flatpak and Snaps for its basic operations, Debian doesn't and hence hasn't set up these variables explicitly. Note that this isn't unique to Guix Home or even just Guix. > For example, if XDG_DATA_DIRS is not set its default value is > "/usr/local/share/:/usr/share/". None of these directories exist in Guix System. Assuming them would be a fault. Note that the install script you're meant to use already initializes these variables since July [1]. > XDG_STATE_HOME is set to a non-standard value.=C2=A0 In the current XDG > Base Directory Specification it defaults to "$HOME/.local/state", but > Guix Home sets it to "$HOME/.local/var/lib". This is a genuine bug with Guix Home. > XDG_LOG_HOME is a non-standard variable.=C2=A0 The spec suggests that log= s > should go in XDG_STATE_HOME.=C2=A0 Why not a establish a GUIX_LOG_HOME > variable instead?=C2=A0 (if it ever does become a standard XDG variable, > its default may not be the same one picked by Guix Home, causing the > same issue as above). Another genuine bug with Guix Home, although the variable does predate our support for XDG_STATE_HOME. I suggest finding all uses of this variable in Guix Home and replacing them accordingly. > Setting XDG_RUNTIME_DIR is not something I would expect Guix Home to > do -- it is the job of whatever logs the user in. I'm unsure about that one. > XDG_CACHE_HOME, XDG_CONFIG_HOME, XDG_DATA_HOME are set to their > defaults unnecessarily. Explicit is better than implicit. Cheers [1] http://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D23aafc800c9e67866276= 6440916449ec5bbce830 From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 13 00:22:23 2022 Received: (at 59474) by debbugs.gnu.org; 13 Dec 2022 05:22:23 +0000 Received: from localhost ([127.0.0.1]:57959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4xkE-0005FO-PX for submit@debbugs.gnu.org; Tue, 13 Dec 2022 00:22:23 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:38359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4xkB-0005F5-U0 for 59474@debbugs.gnu.org; Tue, 13 Dec 2022 00:22:21 -0500 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id D6EADFF805; Tue, 13 Dec 2022 05:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1670908933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gvZ11GlABeTDkpkqWTEy4xFDtCQYehZcyeHsv7r9dQk=; b=nurzzDnKkXGj/f4GNOF8EkUJxIr9r+nfuwtB0dP7n9J7434vx71k/Ubj97abovbKoxkakl wP5J2iVgLWJyJoP33MyQUrzADPKKCsi12KBvpxqUjQopL/xRlhM0NK786Z9biJB1c3QhFA 7GgJMkR1fQpvy3iUNIL0P1f1BKXWs01RmPWuC4pU/kbBBjXa6TDXC9IrqjTIIA4lNrxVpg rz0vLRYTaBYcFsCpP5I+mIQya5ZuelcqVQZUtYHCaPf1Oq12XL5YRbl6xbQLGWBpkdX5VT Ikf3thSxJaPkDa0NsdIqYzxNTKWT/JhbidbXhEQx0u5LpsnhCvqhYih/ESlX4Q== From: Andrew Tropin To: Liliana Marie Prikler , 59474@debbugs.gnu.org Subject: Re: bug#59474: Guix Home generated .profile sets XDG_ vars that break GDM+Gnome login on foreign distros In-Reply-To: References: <87fsebbk80.fsf@rfc20.org> Date: Tue, 13 Dec 2022 09:22:07 +0400 Message-ID: <878rjbaneo.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 59474 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; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-11-22 08:09, Liliana Marie Prikler wrote: > Am Montag, dem 21.11.2022 um 22:02 -0800 schrieb Matt Armstrong: >> The first thing I see is that $HOME/.guix-home/seutp-environment is >> modifying various XDG_ variables incorrectly.=C2=A0 It prepends new valu= es >> without honor the variable's default value if it doesn't happen to be >> set already. > This is a known problem with Debian. Unlike Ubuntu, which relies on > Flatpak and Snaps for its basic operations, Debian doesn't and hence > hasn't set up these variables explicitly. Note that this isn't unique > to Guix Home or even just Guix. > >> For example, if XDG_DATA_DIRS is not set its default value is >> "/usr/local/share/:/usr/share/". > None of these directories exist in Guix System. Assuming them would be > a fault. Note that the install script you're meant to use already > initializes these variables since July [1]. > I understand the inconvinience, but not sure that it has to be fixed on Guix Home side. According to the specification it's a fallback value not a default value. =2D-8<---------------cut here---------------start------------->8--- If $XDG_DATA_DIRS is either not set or empty, a value equal to /usr/local/share/:/usr/share/ should be used. =2D-8<---------------cut here---------------end--------------->8--- XDG_DATA_DIRS is not empty in our case and hence /usr/local/share and /usr/share doesn't have to be used. If it's critical for operation it should be set before ~/.guix-home/setup-environment called, I would say it looks like a debian bug, not Guix Home. They same thing is true for XDG_CONFIG_DIRS. >> XDG_STATE_HOME is set to a non-standard value.=C2=A0 In the current XDG >> Base Directory Specification it defaults to "$HOME/.local/state", but >> Guix Home sets it to "$HOME/.local/var/lib". > This is a genuine bug with Guix Home. > >> XDG_LOG_HOME is a non-standard variable.=C2=A0 The spec suggests that lo= gs >> should go in XDG_STATE_HOME.=C2=A0 Why not a establish a GUIX_LOG_HOME >> variable instead?=C2=A0 (if it ever does become a standard XDG variable, >> its default may not be the same one picked by Guix Home, causing the >> same issue as above). > Another genuine bug with Guix Home, although the variable does predate > our support for XDG_STATE_HOME. I suggest finding all uses of this > variable in Guix Home and replacing them accordingly. > XDG_STATE_HOME and XDG_LOG_HOME apppeared in Guix Home before they were described in xdg base directory specification, so the values was picked to mimic FHS. Probably they should be adjusted to the values defined in specification. >> Setting XDG_RUNTIME_DIR is not something I would expect Guix Home to >> do -- it is the job of whatever logs the user in. > I'm unsure about that one. > If it's set by elogind or whatever - cool, we will use value provided, if not we explicitly set it, looks ok to me. >> XDG_CACHE_HOME, XDG_CONFIG_HOME, XDG_DATA_HOME are set to their >> defaults unnecessarily. > Explicit is better than implicit. > > Cheers > > > [1] > http://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D23aafc800c9e678662= 766440916449ec5bbce830 > > > > =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmOYC/8ACgkQIgjSCVjB 3rAfLRAAgk8UL7/20et2ctJwBgb8ZHdwj6S4tcxseQWr7n8svOVQbIhsubNp9YFz mPHIcfU/FlfsgPbR8dA8A8jYt1qmbkj1qEUKw49bJgM8TfUnAU9SvtimgTkmnKmX sPDPAIqKssbUxj2iTBABlHrZ+S1ngkeLP27FZSf3a0EiU5u9AgQwCh7yYeQeEB96 mPROypN6IGEPbk0gaKV1O1JXG4VPDJNQnVIB4aJXIgth47Oey2WEESh/c0zOQL7G 7GTURcwnYZYKvm1r4X6lFTRAP6OgR1Io802GMso4rtsX0Skj8U1k6RkX9g/aHeEK PWyTEREwbsuEMPhnLbmuvgswYRLKRJlv0eNDajmKWScF1rjHOCmoIvXUfbEQ8r1m 72Bu95sJNovnAFBkIVe3tXfJuitQ+UFfJBhe7SRyucTdcjKW5Nlgn010EQaLfaF2 c2Yf1SN3tg64ho6+KxIEzLLkOoGQ8pM/EgNTv1vbsdgdq6T6k7XqoOTNf3eo8EZw GwiZQHhb9jxlfczwB5BKcturMJzg0mI5GWymqDcZOO/NIpsGX0B+/IfNNkGzRlnE k7LHgBELEDsBSHaCtkktrxFZP6Ix0Z0ggC/yYsWp440R5+QVXKq26tF0Kb9M8qJz 09+8uIuliZKKgGcrS+SehXjHfoTYGTQTMUYz7MNBxvfaZgP5B9A= =r30T -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon May 01 22:55:55 2023 Received: (at 59474) by debbugs.gnu.org; 2 May 2023 02:55:55 +0000 Received: from localhost ([127.0.0.1]:41368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ptgBH-0008Jx-3i for submit@debbugs.gnu.org; Mon, 01 May 2023 22:55:55 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:35875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ptgBD-0008Jf-Jg for 59474@debbugs.gnu.org; Mon, 01 May 2023 22:55:54 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id B0FA640004; Tue, 2 May 2023 02:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1682996145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8EzuGhn/U55Xi5nISqazD8L8lOzwA+nLj6G9gBcOPQw=; b=C6MdpgaHCrResQN6l2ucCOL7JSHYbzzJKnHwK5cwqIeM9544KjxnQs40MS5K0JN9Mcr4oa P5v26GgmTZNRWi2U9xGmqKH/UuH/0nJTWY3KxNvyOmvhNTO4nVwUiqOy1/IAhXi2jq5Zux rMTioOPztvrJ4qmngcss2jgTx9mMq8+oPJdfxYnOWLUfPd811jiJkSo1K5n8C5U1Zi3sxl Zsjx5qbGqeNFxslJ81gHQ5lmmgc8kL67i8DwFcYiWuFITfIVONl/jfe/iRKBFjHhPMz9k3 k7Ri+DxnDsfqViNC8WuNEwfaylq6HPz0YsIZaymIhumHmRW4u3UUtmYk1RE+TA== From: Andrew Tropin To: Matt Armstrong , 59474@debbugs.gnu.org Subject: Re: bug#59474: Guix Home generated .profile sets XDG_ vars that break GDM+Gnome login on foreign distros In-Reply-To: <87fsebbk80.fsf@rfc20.org> References: <87fsebbk80.fsf@rfc20.org> Date: Tue, 02 May 2023 06:55:40 +0400 Message-ID: <87h6sv1lxv.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 59474 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-11-21 22:02, Matt Armstrong wrote: > I am experimenting with Guix Home on Debian Testing, using GDM+Gnome. > The .profile generated by "guix home reconfigure" broke logging in to > the Gnome desktop. The gnome session would die, failing to initialize > what it considered to be essential things, and return to the login > screen I could log in to a tty, and was able to undo the new .profile > and get back to a working system. > > The home-configuration.scm I used was generated by "guix home import" > and was quite simple: > > ---------------------------------------------------------------------- > (use-modules (gnu home) > (gnu packages) > (gnu services) > (guix gexp) > (gnu home services shells)) > > (home-environment > ;; Below is the list of packages that will show up in your > ;; Home profile, under ~/.guix-home/profile. > (packages (specifications->packages (list "glibc-locales"))) > > ;; Below is the list of Home services. To search for available > ;; services, run 'guix home search KEYWORD' in a terminal. > (services > (list (service home-bash-service-type > (home-bash-configuration > (aliases '(("ls" . "ls --color=3Dauto"))) > (bashrc (list (local-file ".bashrc" "bashrc"))) > (bash-logout (list (local-file ".bash_logout" > "bash_logout")))))))) > ---------------------------------------------------------------------- > > Note: a stock GDM+Gnome setup runs the user's login shell when logging > in via the GDM display manager, and this shell execs > gnome-session-binary. This doesn't necessarily happen with other > display managers or other desktop environments, so on those systems the > Guix Home .profile may not even run before the DE is initialized. > Nearly all of my time debugging this was spent figuring this out! :-) > > The .profile file generated by Guix Home is this: > > ---------------------------------------------------------------------- > HOME_ENVIRONMENT=3D$HOME/.guix-home > . $HOME_ENVIRONMENT/setup-environment > $HOME_ENVIRONMENT/on-first-login > ---------------------------------------------------------------------- > > The first thing I see is that $HOME/.guix-home/seutp-environment is > modifying various XDG_ variables incorrectly. It prepends new values > without honor the variable's default value if it doesn't happen to be > set already. > > For example, if XDG_DATA_DIRS is not set its default value is > "/usr/local/share/:/usr/share/". > > But .guix-home/setup-environment will instead prepend a value without > checking, leaving XDG_DATA_DIRS set incorrectly to > "$HOME/.guix-home/profile/share:" when it should be > "$HOME/.guix-home/profile/share:/usr/local/share/:/usr/share/". > > See this code in setup-environment: > > case $XDG_DATA_DIRS in > *$HOME_ENVIRONMENT/profile/share*) ;; > *) export XDG_DATA_DIRS=3D$HOME_ENVIRONMENT/profile/share:$XDG_DATA_DIR= S ;; > esac > > The correct idiom is this: > > XDG_DATA_DIRS=3DPATH_TO_PREPEND:${XDG_DATA_DIRS:-/usr/local/share/:/usr/s= hare/} > > or > > XDG_DATA_DIRS=3D${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}:PATH_TO_A= PPEND > > The above is what I see in various Nix and Snap configuration files. > > Because I have a few other things installed that modify XDG_DATA_DIRS > before Guix Home does, Guix Home doesn't break that particular variable. > > It did break XDG_CONFIG_DIRS, since Guix Home was setting it to > "$HOME/.guix-home/profile/etc/xdg:". I worked around this problem by > running this code before Guix Home's .profile: > > # Note: when XDG_CONFIG_DIRS is not set Guix home sets > # XDG_CONFIG_DIRS=3D"$HOME/.guix-home/profile/etc/xdg:", which removes > # the default "/etc/xdg" value. > if [[ -z $XDG_CONFIG_DIRS ]]; then > XDG_CONFIG_DIRS=3D/etc/xdg > fi > > # Note: when XDG_DATA_DIRS is not set Guix home sets > # XDG_DATA_DIRS=3D"$HOME/.guix-home/profile/share:", which removes the > # default "/usr/local/share:/usr/share" value. > if [[ -z $XDG_DATA_DIRS ]]; then > XDG_DATA_DIRS=3D"/usr/local/share:/usr/share" > fi > > I have other more minor quibbles about how Guix Home handles XDG values: > > XDG_STATE_HOME is set to a non-standard value. In the current XDG Base > Directory Specification it defaults to "$HOME/.local/state", but Guix > Home sets it to "$HOME/.local/var/lib". On a foreign distro this is > going to cause some disruption when a user switches to Guix Home, or > switches away. > > XDG_LOG_HOME is a non-standard variable. The spec suggests that logs > should go in XDG_STATE_HOME. Why not a establish a GUIX_LOG_HOME > variable instead? (if it ever does become a standard XDG variable, its > default may not be the same one picked by Guix Home, causing the same > issue as above). > > Setting XDG_RUNTIME_DIR is not something I would expect Guix Home to do > -- it is the job of whatever logs the user in. > > XDG_CACHE_HOME, XDG_CONFIG_HOME, XDG_DATA_HOME are set to their defaults > unnecessarily. > > I modified my personal config by unsetting XDG_STATE_HOME, XDG_LOG_HOME, > XDG_CACHE_HOME, XDG_CONFIG_HOME, and XDG_DATA_HOME if Guix Home left > them set to their default values (in the case of XDG_STATE_HOME I unset > it unconditionally). XDG_DATA_DIRS behavior seems reasonable, the problem should be reported to Debian. The work on STATE_HOME is happenning in a separate thread. Closing this ticket. Let us know if you have some other thoughts on the topic. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmRQe60ACgkQIgjSCVjB 3rAg5A//Sk6ZE0xxtXa3r0wMKoeQL6R9TCNHGahzLYCBkYceLoDZ+jvN0HogUKPo du14vMn/Td14VFq3C/XoTi9KNWfDhyKCIKJvGXlX5DqEuGiY5ee6fdboVDbKkVYJ Quq7diUDXcqvXHSKgOUALBdxHlGLbPhXZNLPtE9w/sH5f6QNiCidrAGriV602VoL p1dvc2qoNLQXTfwMBi/opuJ1Acy2VYdO+g/tVfWi5lUjLu3WpoHoy12j9UP4ckJb 78g4TlRMqK87EY7OKSNyIf5Cl6GMT3v8NiWDnGmvJsfgeWuUKZcBfg6J4F/6LWZz LFKnlLbzF1rDK5xBFp1/xb8FyScnZrXd4NnU57Lay5NI23+22/oQ4e6RfTMyF+9O r6olY2Q40Zs9w2lfVnC4jJ4YS+e1LusgBeZ+tiIcgFdqx5eeGI50YG2iI+TlWeyv OGm7c5cQ25prnGM00EbLzlLPj8XiBFodXUHQaXLFLJPBfZ4AsRQc6zXrrVY2byR/ ttyiGNpxapj6TKJXXE4hlbMJIFyTmjQLJszigMorup7+f/BhwkJz5v5KaMYxwzMZ N5BXEmuM/8SwbM4tQ8poAAPO6Tk6QIxsbeFlhrf8goAxD+GmYPegG5sJPwaSwNkm eFUwamz8mqyZj/ATOxr3f3A+e30EKNGQsGVW6Phndo5UQ06nGSQ= =+bqj -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon May 01 22:56:57 2023 Received: (at control) by debbugs.gnu.org; 2 May 2023 02:56:57 +0000 Received: from localhost ([127.0.0.1]:41372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ptgCG-0008La-PK for submit@debbugs.gnu.org; Mon, 01 May 2023 22:56:56 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:35389) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ptgCD-0008LL-Qa for control@debbugs.gnu.org; Mon, 01 May 2023 22:56:55 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 780FE240009 for ; Tue, 2 May 2023 02:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1682996207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=/mwvrpqtlqHHhc89+yRvcVR1ZDM30FDc4Y4p+benrFo=; b=N2mP6b+DgUnp8LHOhMmDblIKkrEvoiEDcTrnFuO5a3Pf9xkLcQPZTzOpAyiB2z1EOmSoRX 24c+55GAVb2ddNHOIz4xif1TkFVHiDhPaCZnON64NESZYdr7B4Pudd10gIBtu15S1mTTow QlrMwSbdORLDaP3409GVEIMmPlDtjECjoiu8nzKz/kPduJj6GAoz39+FHqXgyZfO37hb9w RR86kLw8gDTWF67o7N05l7f16TUzNPgseph7aQ0UC+V10sv8vlxmlPsDaSdsf4ZioZdjHe QJGyqaFXlYy1Jw3wgFUzZrMI0q2/TTfXJpGXjzxJwG6wA8QtdNykhzmGgeG/sw== From: Andrew Tropin To: control@debbugs.gnu.org Subject: Date: Tue, 02 May 2023 06:56:44 +0400 Message-ID: <87ednz1lw3.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close 59474 Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [217.70.178.230 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.178.230 listed in list.dnswl.org] 0.0 TVD_SPACE_RATIO No description available. 2.0 BLANK_SUBJECT Subject is present but empty X-Debbugs-Envelope-To: control 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.3 (/) --=-=-= Content-Type: text/plain close 59474 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmRQe+wACgkQIgjSCVjB 3rAYkA//bal/hQlVevBVXGOSwyaojW/U2GQrsbM1CakaDsDnHFPtseIgU/szIWeo K+Mf2xRKvh8SXxvcdceja8kA925y7pC6QqFKizmM3zXE48JPer20kxCHzkA0Ud00 ZOiAtnC2ijvpbvGDFbX3KcNPELL00Am1ATNZulZzZNIdKci/+3O8YwkTFxyzphit Y5femPR95XvOg58u6n+Scz7ScbXGxiAU5qhCBmYh/RDyFFtRTgKB3ZsZCWnCQUsR tUlMpS5iuG/eVrx3l8khTPkCtW0KB65ZNQ0dcw2CHN7/hh1V06b3uwHCYHtTyfvZ dARwwmL3JjemR2RAERXsymaH5Sf+2BlTwg+570XxxPwqwu8x/JTCXVyWI+Hayeg4 4MC/2TuePF/GPGTUppw6hDScKWxFVtf0qdbaVWvAoEbAuXa+Ki5uqZ6fIxyJ086L hbFiLvbnp3+aIlUqzV19DBhMgxxZF0hMKmY7Q7/Dd+s12jgUkIzZvhoQqpESxfr9 yr5eOaoB49Eqnu1XC70fmHJIo0BDChY1S/5ibZ+aNZtJSZA486LM5Qry3761wtqC 0f1rLlxoPv3Qxm33XF2jXeUoZUGL7+savTEM9T+8xOuwKX+8htZLS6V7ybPX+ZK7 pDrbSSyEhYWzJeei8KpvidPYkfqrbFNmCRo/BWWIqxQh3aSPgjg= =+p67 -----END PGP SIGNATURE----- --=-=-=-- From unknown Mon Aug 18 11:12:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 30 May 2023 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator