From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aNaNFegR7GH+JAAAgWs5BA (envelope-from ) for ; Sat, 22 Jan 2022 15:17:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uN3uEegR7GEoHgAAauVa8A (envelope-from ) for ; Sat, 22 Jan 2022 15:17:12 +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 B0D702868C for ; Sat, 22 Jan 2022 15:17:11 +0100 (CET) Received: from localhost ([::1]:33276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBHCY-0006Dl-PJ for larch@yhetil.org; Sat, 22 Jan 2022 09:17:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBHCQ-0006Dc-DJ for guix-patches@gnu.org; Sat, 22 Jan 2022 09:17:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43152) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nBHCQ-0007uE-3K for guix-patches@gnu.org; Sat, 22 Jan 2022 09:17:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nBHCQ-0003Vm-0C for guix-patches@gnu.org; Sat, 22 Jan 2022 09:17:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53447] [PATCH] doc: Unset environment variables considered harmful Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Jan 2022 14:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53447 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53447@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164286101913484 (code B ref -1); Sat, 22 Jan 2022 14:17:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Jan 2022 14:16:59 +0000 Received: from localhost ([127.0.0.1]:36055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBHCN-0003VP-5A for submit@debbugs.gnu.org; Sat, 22 Jan 2022 09:16:59 -0500 Received: from lists.gnu.org ([209.51.188.17]:35382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBHCL-0003VI-Ov for submit@debbugs.gnu.org; Sat, 22 Jan 2022 09:16:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBHCK-0006DU-Uh for guix-patches@gnu.org; Sat, 22 Jan 2022 09:16:57 -0500 Received: from [2a00:1450:4864:20::443] (port=42882 helo=mail-wr1-x443.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nBHCJ-0007te-Cn for guix-patches@gnu.org; Sat, 22 Jan 2022 09:16:56 -0500 Received: by mail-wr1-x443.google.com with SMTP id a13so5078067wrh.9 for ; Sat, 22 Jan 2022 06:16:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:subject:to:content-transfer-encoding:message-id :mime-version; bh=nok2hJiP/4x23WJQTprT+KHLTN2O4FgLumAs1rSpdm4=; b=XwTuLxyQpM8M79GACRkEI09Z/DoRX4gLpgSXjbJS2vUsv8b00ah+Mhmb0aPeJCLSem Ctnlgs8kZgo9j132uoyZR6eU7nw8Sw0NG2maWOKBEqGIZubq315UgS8AcWoXOMuAn/nX 4elU2zFUBkkF4dbpasPes/2t7yFAsxP4BVr6F3B4Fj2ayeC9fakAVM7G1Ny82FggzDdO SI+H9/pk+xNnq6g+AhJagsnM97OGKVzs2OZvmRqCODJj9wyk8LJcjpH0eSYeRVm6EBIf KgCQ1HImBPEygdit/0CMRePeOzfAfHZJUvgU6Hp8d3fm7jUeAtP1YaTAqikA8AbDIKKe hc9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:to:content-transfer-encoding :message-id:mime-version; bh=nok2hJiP/4x23WJQTprT+KHLTN2O4FgLumAs1rSpdm4=; b=pr65wuwAkaTmar+ZLRK1tvFMa7rKDkDGaSzPGv5BeugT7lqrw+fqKnexqlMmKbrPuW TvBvT8WhjbgSyofKPHzArRW74ly1OEThdc2jBJmI8Jn+ehpJP2xnNz3Bi0UGpMH4Onyc 5MW7IsANeu6gT2jlYbc9QUVBMRJ51EYOWsazB+A5G8+wtllT+wn+5zCuGcDDNvZBfJmD P9ywQBOZh7XuldMpapKtiikGAJRqHIuwJE3j86KSzg9cFBF9EzEX6VRrfNtOqG8LNRlG 5kWNb24inC+gx4oW58zGxM9+l8zqo/0oPGFQqIZg5yBsotRf6BL3WXwFZgV3D7sGEe4f QUBw== X-Gm-Message-State: AOAM533SDbcYzWbwXvPP69dWFGvaZ5gUMVtW7R5Oq5wY6104a85GSMTF XsrYuK5GbID8ku/nyOoSvRtkZ/ciz6k= X-Google-Smtp-Source: ABdhPJzJEmvl8n4Qg7zrshbxDW8W2AHtABLJnPt+ZrB0H0xPC/JOXPkprF3KOcf5/uQR7RsFvANklg== X-Received: by 2002:adf:dec3:: with SMTP id i3mr1420349wrn.225.1642861010937; Sat, 22 Jan 2022 06:16:50 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id z13sm10280551wrm.90.2022.01.22.06.16.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jan 2022 06:16:50 -0800 (PST) From: Liliana Marie Prikler Date: Sat, 22 Jan 2022 15:13:20 +0100 Content-Transfer-Encoding: 7bit Message-ID: MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::443 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=liliana.prikler@gmail.com; helo=mail-wr1-x443.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642861031; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=nok2hJiP/4x23WJQTprT+KHLTN2O4FgLumAs1rSpdm4=; b=Otz/J/cri+/etoUjWp7eATwQvj9Hy7+VQvA6l0eiF3suMu2MUXHx3clQkf6O27dXrldkg5 wc5NuzFGxtyJC3bAdXelmfadUtc1ugxhcKMZCj2G7dgqkr4OSEPYPvaLLjDfW/XsscgGiJ 6C2sw87nDdJdjF5Mw6pTv5XVTn1JOpiw472rK8/U0K3tphrhrBULn0m3OuxKuUfn8Q6M8Z 6eCYHe1IOjaVToNz/9uT5cPwhuBMoBPkrn6V/Q8bbWkpnL0SEjzY/Zj/2M9lJJluidsRGy 97id0q/3sj5YR9Q7kw3AhjMisFY2F4xhKyzHJjfB8e3fcsio0uO4HaLFtOt37Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642861031; a=rsa-sha256; cv=none; b=LJdEYU3kEAvdf5dToDWAoT06B4v7EmCXhxT+UdzbGG0ipt4f7iEFA0/wz45tJ21HH5SW0i s3f6sXdrUhJYWnXifz+F+UvsuZKbVU9j/ST7SJ8LwkkhGh4RwN1sXuwWNyhQ27sUvJGyP1 ftC3QbtsKzaR2QlU4ErZxPP0tzw3XY4OuUL+wkTmUO904eXe3E5+ThrvNFzITdTmW2GGRX 45F/14VITg00CSKnAVOYHKPPUez+jKSpheRZXb9ig6E77uVhSbIcb5ibsZEyPMUdP7IAOn MmitYHshqZOXbMaK6aNxbz0hxFc7s4X4YUuGDmDuB+uvMqVVu/iqpgQV5KCRNw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=XwTuLxyQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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-Spam-Score: -2.23 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=XwTuLxyQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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-Queue-Id: B0D702868C X-Spam-Score: -2.23 X-Migadu-Scanner: scn1.migadu.com X-TUID: 75KaaLSDqtVU * doc/guix.texi (Application Setup): Add subsection for implicit environment variables. --- doc/guix.texi | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 912a8e3c5a..805e3b611f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2023,6 +2023,33 @@ want to avoid auto-loading the Emacs packages installed with Guix, you can do so by running Emacs with the @option{--no-site-file} option (@pxref{Init File,,, emacs, The GNU Emacs Manual}). +@subsection Implicit Environment Variables + +Many environment variables are defined in a way that assumes a certain +default value, even if unset. For example, bash uses the current +working directory as @env{PATH} if unset, or @env{XDG_CONFIG_HOME} +expands to @file{$HOME/.config}. Some of these defaults remain the same +whether a package is used through Guix or not---however, environment +variables referring to @file{/etc} or @file{/usr} typically have their +meaning subtly changed in Guix. An application installed via Guix might +instead look up files in its own @file{etc} structure, or (if a +search-path was specified) even override the default for packages from +the foreign distro. + +In order to avoid problems coming from such implicitly defined +environment variables, it is best to explicitly define them somewhere. +Startup files like @file{~/.bash_profile} are usually a good location +to do so. However, not all setups treat them equally. While on Guix +System, the user's login shell is used to spawn a graphical session, +other distros may choose a different approach. For instance, systemd +is capable of spawning graphical applications in a clean environment, +but allows said environments to be modified through an +@file{override.conf} placed in the right directory. + +Regardless of which method is used to set such environment variables, +they typically should only be set once at login. Placing them in files +like @file{~/.bashrc} or similar has adverse effects on other commands +that want to create clean environments, such as @command{guix shell}. @node Upgrading Guix @section Upgrading Guix -- 2.34.0