[bug#76082,0/9] Improve profile initialization on foreign distros plus misc improvements
Message ID | cover.1738814583.git.liam@hpfr.net |
---|---|
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DFF0B27BBEA; Thu, 6 Feb 2025 04:09:41 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B2FB427BBE2 for <patchwork@mira.cbaines.net>; Thu, 6 Feb 2025 04:09:40 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1tftCT-0006aX-27; Wed, 05 Feb 2025 23:09:13 -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 <Debian-debbugs@debbugs.gnu.org>) id 1tftCO-0006Zl-Uv for guix-patches@gnu.org; Wed, 05 Feb 2025 23:09:09 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tftCN-0003yz-Df; Wed, 05 Feb 2025 23:09:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=zzBZGsdwMx4Hn7vFE3kDoZ+JaiSZI9uKJcQ3dPnjaoE=; b=iBfqV9QEoJTruxSbJJb/1N8wrTk62TnKnkTz67tXCzcXWXIqtGu/o3wXQNa4o7VqE9/mFUCIHT5G+8BA8YUT8NvykW3+hprURQW4h+6kFlksNrmbPnKUL4y8GSpnHUOw9o7GLqcGfu2mBx8IYjrHOik0k5ErNhJqs5xslpG4XlhKmh8OEhLOc3GRkkrQy7NPVLnxfvMeowxZYLn9u1QyK7dPWGQtpGrdbfcMkAhHkb+aVGfSeBrAMwF7U9P+Q9mQBj8IkqSJJ77TESG+G4arI+Z4ObD4ImQ8Og24XE7Yol2h5NL3Nlvl82N9EEKPnX3F7QqCFVmbPkL8TwrYZa6yGg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tftCI-0001dW-J8; Wed, 05 Feb 2025 23:09:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76082] [PATCH 0/9] Improve profile initialization on foreign distros plus misc improvements Resent-From: Liam Hupfer <liam@hpfr.net> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: andrew@trop.in, janneke@gnu.org, ludo@gnu.org, tanguy@bioneland.org, vagrant@debian.org, guix-patches@gnu.org Resent-Date: Thu, 06 Feb 2025 04:09:02 +0000 Resent-Message-ID: <handler.76082.B.17388148986225@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 76082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76082@debbugs.gnu.org Cc: Liam Hupfer <liam@hpfr.net>, Andrew Tropin <andrew@trop.in>, Janneke Nieuwenhuizen <janneke@gnu.org>, Ludovic =?utf-8?q?Court=C3=A8s?= <ludo@gnu.org>, Tanguy Le Carrour <tanguy@bioneland.org>, Vagrant Cascadian <vagrant@debian.org> X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Andrew Tropin <andrew@trop.in>, Janneke Nieuwenhuizen <janneke@gnu.org>, Ludovic =?utf-8?q?Court=C3=A8s?= <ludo@gnu.org>, Tanguy Le Carrour <tanguy@bioneland.org>, Vagrant Cascadian <vagrant@debian.org> Received: via spool by submit@debbugs.gnu.org id=B.17388148986225 (code B ref -1); Thu, 06 Feb 2025 04:09:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Feb 2025 04:08:18 +0000 Received: from localhost ([127.0.0.1]:53572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1tftBa-0001cL-Ao for submit@debbugs.gnu.org; Wed, 05 Feb 2025 23:08:18 -0500 Received: from lists.gnu.org ([2001:470:142::17]:38656) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <liam@hpfr.net>) id 1tftBV-0001ba-Gn for submit@debbugs.gnu.org; Wed, 05 Feb 2025 23:08:15 -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 <liam@hpfr.net>) id 1tftB5-0006TL-HE for guix-patches@gnu.org; Wed, 05 Feb 2025 23:07:52 -0500 Received: from out-183.mta0.migadu.com ([2001:41d0:1004:224b::b7]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <liam@hpfr.net>) id 1tftB2-0003su-GA for guix-patches@gnu.org; Wed, 05 Feb 2025 23:07:47 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpfr.net; s=key1; t=1738814856; 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: content-transfer-encoding:content-transfer-encoding; bh=zzBZGsdwMx4Hn7vFE3kDoZ+JaiSZI9uKJcQ3dPnjaoE=; b=I5nIlOYwSJ9JRKs1T12hs6YGe42o+S7iCJRRM80PVmi7Ona1OAHF/l+4a+gm9xHJR4UCYj 8kClSYTyoUz+UG9eYKxaciA5zMo+InjBTmUQ4t8lqvmh5K7xy8E1WtUIPJ1J7VvWDChLbw aHmtG6F08JKiVCaHDsF7UyRscZBWSgFc7EeZrEiaNvBIdi01zuaiJD6y7H6TFNtCTLZ7Dq Jk0KU0mnSg73BBzB2NIT24E9E3wDcALc7RY/VHqYdHsckjUrYsiE/XmE+Ynxn1xFhn6EOa J4I41tJraaPp00+P3TqMJH/oKR74/APTaDkYq1PeF9vza92YX7Sp7Qbgfek8FQ== From: Liam Hupfer <liam@hpfr.net> Date: Wed, 5 Feb 2025 22:07:20 -0600 Message-ID: <cover.1738814583.git.liam@hpfr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:1004:224b::b7; envelope-from=liam@hpfr.net; helo=out-183.mta0.migadu.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_PASS=-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: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
Improve profile initialization on foreign distros plus misc improvements
|
|
Message
Liam Hupfer
Feb. 6, 2025, 4:07 a.m. UTC
Hi Guix! Hope those who attended enjoyed Guix Days and FOSDEM. Looks like the Whippet talk is the first recording from the DMC track to go up! This series modifies the /etc/profile.d/zzz-guix.sh deployed by guix-install.sh (and tweaks Guix Home’s setup-environment script) to make search path initialization a little more consistent based on my experiences using Guix on NixOS and Ubuntu. Currently, new users tend to end up with numerous duplicate search path entries, which can be confusing when trying to grok profiles and search paths early on. Ironically, NixOS and Ubuntu both ship “native” Guix packages. I figured I should start by improving the upstream installation script, though, since it tends to inspire foreign distros’ Guix package recipes. While I’m here, I did some general tidying as well. The most contentious change is the removal of any attempt to initialize Guix Home from /etc/profile.d/. The rationale here is that Guix Home has more in common with Guix System than the ‘guix pull’ and default imperative user profiles. Guix Home can do arbitrary things at profile initialization. It initializes itself in ~/.profile by default and documents shell configuration to source ~.profile if the user doesn’t also manage their shell with Guix Home. Since Guix Home can manage itself, we can keep it self-contained rather than trying to keep /etc/profile.d/zzz-guix.sh in lockstep with Guix Home’s dedicated initialization code. I tested the updated install script in a Debian container via Incus (LXD successor) and the updates to Guix Home via ‘./pre-inst-env guix home container home-test.scm’ with a small home environment. Additional testing is appreciated, of course! Along with the Guix Home team, Vagrant is Cc’d since these changes may inform changes to the Debian package (thank you for developing it, btw!). I help maintain the NixOS module and plan to update it accordingly once these changes make it through review. Thanks! Liam Hupfer (9): home: services: setup-environment: Use GUIX_PROFILE. home: services: Unset variables after profile init. home: services: setup-environment: Set GUIX_LOCPATH. guix-install.sh: Remove system-level Guix Home initialization. guix-install.sh: Improve Guix profile sourcing. guix-install.sh: Add to MANPATH. guix-install.sh: Appease shellcheck. guix-install.sh: Add msg helpers and use stderr consistently. guix-install.sh: Check for existing installation before downloading. etc/guix-install.sh | 264 ++++++++++++++++++++--------------- gnu/home/services.scm | 32 +++-- gnu/home/services/shells.scm | 3 +- 3 files changed, 171 insertions(+), 128 deletions(-) base-commit: 52c05f3b120e641c8bd2d68cfcf0d6af947de27b
Comments
Hi Liam, Liam Hupfer <liam@hpfr.net> skribis: > Hi Guix! Hope those who attended enjoyed Guix Days and FOSDEM. Looks > like the Whippet talk is the first recording from the DMC track to go > up! :-) Good time in Brussels! > home: services: setup-environment: Use GUIX_PROFILE. > home: services: Unset variables after profile init. > home: services: setup-environment: Set GUIX_LOCPATH. > guix-install.sh: Remove system-level Guix Home initialization. > guix-install.sh: Improve Guix profile sourcing. > guix-install.sh: Add to MANPATH. > guix-install.sh: Appease shellcheck. > guix-install.sh: Add msg helpers and use stderr consistently. > guix-install.sh: Check for existing installation before downloading. This all looks reasonable and largely safe to me to I went ahead and applied it. Everyone else: please speak up if you think something needs to be adjusted or discussed. Thanks! Ludo’.
Hi Ludo! Ludovic Courtès <ludo@gnu.org> writes: > This all looks reasonable and largely safe to me to I went ahead and > applied it. > > Everyone else: please speak up if you think something needs to be > adjusted or discussed. Glad to hear it! I’m a little apprehensive without others’ feedback since the install script is particularly difficult to test considering the heterogeneous environments where it can be used, but we can see what crops up now that it’s live. Also, I realized I forgot the copyright lines 🤦. I sent a [follow-up patch] to the bug. > Thanks! Thank you! —Liam [follow-up patch] <https://yhetil.org/guix-patches/05f77325a8e56a88f92480b3e17712d4000fc910.1740256618.git.liam@hpfr.net/>