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 INGTEYZhjmPaMwEAbAwnHQ (envelope-from ) for ; Mon, 05 Dec 2022 22:24:22 +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 iJJqEYZhjmOFcgEAauVa8A (envelope-from ) for ; Mon, 05 Dec 2022 22:24:22 +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 0FE2ADE17 for ; Mon, 5 Dec 2022 22:24:22 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2IwH-0002hD-2C; Mon, 05 Dec 2022 16:23:49 -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 1p2IwE-0002gn-FO for help-guix@gnu.org; Mon, 05 Dec 2022 16:23:46 -0500 Received: from koszko.org ([93.95.227.159]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2IwC-0002ug-CJ for help-guix@gnu.org; Mon, 05 Dec 2022 16:23:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=koszko.org; s=mail; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ZcZpik8zeKYHEj1O9t1NzmkHSv/sF0rgDsz3X7Q6fzY=; b=kvfwgcz+Dq0SZgZ96rg8RCV5qE du623PWG3zEiAj3B7QVafLbmMdnQ25IuPUvg1D/kd5ugCWr0FWm1jQmbSDl/VwbpK9UOqrwWvR8xa 2JqGdbNcUmINVMAdY/Kcl7w0yZvVsxhwuH5jPQ4Zj94gM9C12+d7Q3iMHBeuI+JmgrKmYkKDxNjGd l08NpDSa+kaXYrov38sviHUeKmRrWm6U84fvBeV1CJ+chZ+VrnzB66xYRCrFILDRtiqCpNd8uDv0D Jlhk7LvzYXdtzbt4STRiCzv64EipPK94ijseF3Kj0WcImTQaA8AVc9azewnBFzmavkTG5onfaTK+E GQK1iGXXvrexo5H6C7mniVJfUjVZVHn3Ut3n5bQDR786Fj8pxIyexkblR0OFAgTYMkE4/n00NfxWZ i20zWhgI5cYSojK5P2t/9BhgWUKNYFRqmYYGG7W72OEvrXXs54RGAuym3m7Bn/OGygx8b6U0LAQSy 9e2gN88CtAkpKHqsYK29J8gW+iualRmzjqVX040woxCPkrF8cWKW2Ic+aMxssvpp7SbdHQNXl1L3v B9UGBDLjAH9pcN+SMS8DTopj4WI16JH464dVxB0mDxZ7btFNjvOpJDcfKdKr5dxEKMC5d06k7/pU6 D5CoH0pQP8HlKkPobl+/b2LPzYQhJsAHR4XzJeAWo=; Received: from [77.252.47.239] (helo=koszkonutek-tmp.pl.eu.org) by koszko.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2Iw9-0005jf-J2; Mon, 05 Dec 2022 22:23:41 +0100 Date: Mon, 5 Dec 2022 22:23:39 +0100 To: Reza Housseini Cc: help-guix@gnu.org Subject: Re: Persistent environment variable Message-ID: <20221205222339.3431d108.koszko@koszko.org> In-Reply-To: <1b93d973-204f-15c5-6148-1e943fb95a96@gmail.com> References: <1b93d973-204f-15c5-6148-1e943fb95a96@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/9ZOv3QqUCxA/R7VFn/c46XV"; protocol="application/pgp-signature"; micalg=pgp-sha256 Received-SPF: pass client-ip=93.95.227.159; envelope-from=koszko@koszko.org; helo=koszko.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Wojtek Kosior From: Wojtek Kosior via Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org 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=1670275462; h=from:from:sender:sender:reply-to: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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ZcZpik8zeKYHEj1O9t1NzmkHSv/sF0rgDsz3X7Q6fzY=; b=mvFvAfGeGkWIAVjiopTCEtigk/sQgKW9VEYTWMjKRJTUsOBWeiIF3SuHXR4MK9fNubJ6L4 MfrIrnaNzKLA6RlBRvIlZNEw3fznir39daIveB8Pz1e6x+cCvEk5t4FZeeKxJ2K7xFBPG9 wx041q9OkEh1BquUgDzpfTbJb1nrCBDtyZqTUHd3DgviqQC9jiJd07xOLd+gxDstyMrJ0x HOzuSqIG6UWVm7Z71HJ+gCGn0zgFjSxpoAL67t/0MVmDnFuykQnATfJTS3enGjjXXqV+ka vhRFeojRF4yPVcdtcos8aiBDvQkExhywY+yd5zc1zleT7p00mRNIkrdiPsuhYA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670275462; a=rsa-sha256; cv=none; b=r3wVOsFFD59g4tClfEQtKvPsP61KGhWwxNI/zDJJ5s9j6IRXSJn78EmiHqWfaAI0t+uShc FPX1HavFuKm96S/SSVPnT4epUBmYIawyicNHa9s25sX7N8/YRpTCIux+ebbxK+kKYjgKL2 IKtdH7hXgb3lU9vCWhKZBc04XJ1J0uGdkaBNGCw/GJ8eX/o7+qU8IEiemr5R3M/Fi4Qvci jS8ZQTnJ7Jjfca8tVAUOkTwFY/gaFA+ydibX2AGKTMZOxHt3ayGHVuLa9kL7nY1f3UBA59 bBsq0rgtO7vN8Nrmkf49u1hEgUTEHz168DRuhU5s8s2LaCbLE0A6q+flSBQ12w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=kvfwgcz+; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.67 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=koszko.org header.s=mail header.b=kvfwgcz+; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 0FE2ADE17 X-Spam-Score: -4.67 X-Migadu-Scanner: scn0.migadu.com X-TUID: WhlfIfSL2Ihn --Sig_/9ZOv3QqUCxA/R7VFn/c46XV Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > Hi List >=20 > Is there a possibility to set an environment variable in a package=20 > recipe which is persistent after the build of the package? So if you=20 > would install the package the environment variable is present then. > Or is this an anti pattern? >=20 > Thanks for any inputs. >=20 > Cheers, > Reza > For exporting various kinds of *search paths* in environment variables, there's a special facility described here[1]. Alternatively, if in your use case it is sufficient to have the variable always passed to some Guix-created executable, you might want to look at the `wrap-program` function from `(guix build utils)`. You can look at how it is used by existing packages. For things like this I usually use a command like grep -RE 'wrap-prog' -A10 -B2 ~/.config/guix/current/share/guile/site/3= .0/gnu/packages | less Unfortunately, I don't feel competent enough to say whether something is an anti-pattern. If any of those 2 solutions fits your needs, that's great. If not, I hope someone else will help you out :) Wojtek [1] https://guix.gnu.org/manual/devel/en/html_node/Search-Paths.html -- (sig_start) website: https://koszko.org/koszko.html PGP: https://koszko.org/key.gpg fingerprint: E972 7060 E3C5 637C 8A4F 4B42 4BC5 221C 5A79 FD1A Meet Krak=C3=B3w saints! #14: saint Jan Kanty Poznaj =C5=9Bwi=C4=99tych krakowskich! #14: =C5=9Bwi=C4=99ty Jan Kanty https://pl.wikipedia.org/wiki/Jan_Kanty -- (sig_end) On Mon, 5 Dec 2022 21:38:14 +0100 Reza Housseini wrote: > Hi List >=20 > Is there a possibility to set an environment variable in a package=20 > recipe which is persistent after the build of the package? So if you=20 > would install the package the environment variable is present then. > Or is this an anti pattern? >=20 > Thanks for any inputs. >=20 > Cheers, > Reza >=20 --Sig_/9ZOv3QqUCxA/R7VFn/c46XV Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQTpcnBg48VjfIpPS0JLxSIcWnn9GgUCY45hWwAKCRBLxSIcWnn9 GvpcAP4tALmw+KnST1txrXVcIxZO/QWaILLkbTdNpAHjpNSGtgD/YdixYTW6PnD9 lGX5JsGt8NGbIuCziD3EgnlyWovLyAE= =fW47 -----END PGP SIGNATURE----- --Sig_/9ZOv3QqUCxA/R7VFn/c46XV--