From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oLUZE3y/SWB6cAAA0tVLHw (envelope-from ) for ; Thu, 11 Mar 2021 06:58:04 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id hyHUDny/SWAWHAAAB5/wlQ (envelope-from ) for ; Thu, 11 Mar 2021 06:58:04 +0000 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 aspmx2.migadu.com (Postfix) with ESMTPS id 589B1C3FC for ; Thu, 11 Mar 2021 07:58:03 +0100 (CET) Received: from localhost ([::1]:56300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKFGk-0003rm-3j for larch@yhetil.org; Thu, 11 Mar 2021 01:58:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKFGa-0003r4-D1 for help-guix@gnu.org; Thu, 11 Mar 2021 01:57:52 -0500 Received: from zm-mta-out-3.u-ga.fr ([152.77.200.56]:51192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKFGX-0000jO-05 for help-guix@gnu.org; Thu, 11 Mar 2021 01:57:51 -0500 Received: from zm-mta-out.u-ga.fr (zm-mta-out.u-ga.fr [152.77.200.53]) by zm-mta-out-3.u-ga.fr (Postfix) with ESMTP id 4BBED4156A; Thu, 11 Mar 2021 07:57:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=univ-grenoble-alpes.fr; s=2020; t=1615445863; bh=tpazugQQZelK7cOrfq/CsQoXLxkKN/1YcMy41nRPsuk=; h=From:Subject:Date:In-Reply-To:Cc:To:References:From; b=XiVHj5jH1NpdKRoLHJ2cXcmnc4oFU/Zrps6fWnhaiPpWBM1BtTXPyjAjDLg4brJCR hLDmSLri8czHnFQgq3WljbOOjOjIHFSDrZm0VQjfd9kudmyIDpABgq2y6/X4Y5H/i0 mfB75o4FEUcgs3czcaT/3pPwUu3lLl850IbAKV5PJrI4e5hbAx9/dwCuOaMiIbZuEG zHpnUcWCF+1ambyC8C+vHTW+Ks3gTKiSRbOJ8KmH8Z89tDyWy9D2MHrM07NRuY/pkZ oQSl9CJxMQoOHNcGwFH164nvvsqdpS+yuJnAgQ38Jw9sEkzMtKLYLPh6KjKp0uErtB S2IcNbp/Pz8NQ== Received: from smtps.univ-grenoble-alpes.fr (smtps3.u-ga.fr [195.83.24.62]) by zm-mta-out.u-ga.fr (Postfix) with ESMTP id 44DA980657; Thu, 11 Mar 2021 07:57:43 +0100 (CET) Received: from [192.168.1.69] (i15-les01-ntr-62-34-148-47.sfr.lns.abo.bbox.fr [62.34.148.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bouttiep@univ-grenoble-alpes.fr) by smtps.univ-grenoble-alpes.fr (Postfix) with ESMTPSA id 2CB244005E; Thu, 11 Mar 2021 07:57:43 +0100 (CET) From: Pierre-Antoine Bouttier Message-Id: Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: nix shellHook equivalent for guix environment? Date: Thu, 11 Mar 2021 07:57:42 +0100 In-Reply-To: <86k0qfcdbc.fsf@gmail.com> To: zimoun References: <7663A078-15A7-41AC-BBAB-AED626151B15@univ-grenoble-alpes.fr> <86k0qfcdbc.fsf@gmail.com> X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Greylist: Whitelist-UGA SMTP Authentifie (bouttiep@univ-grenoble-alpes.fr) via submission-587 ACL (100) Received-SPF: pass client-ip=152.77.200.56; envelope-from=Pierre-Antoine.Bouttier@univ-grenoble-alpes.fr; helo=zm-mta-out-3.u-ga.fr 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, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615445883; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Dzyvw2HZNAHTCLpcWEo/pGCFx7W3LDGfK4YO24clm6M=; b=kCT6EResPvlDxqK3y/x3bEi8taBbqssrPu0u0auvncuOLzybO1FKeC2Mwm6aFXxlwTSZPV HE3rTbU+oplU0G0/iNelO4rQWAIQ7hfPAMUielGvyNJXLKp1BOsyAneyQPeh2mttqOJMPD kfIstw330ZW/K4Jigm75mxoAy/zhc66z8WupX5Xbyaqsfpjk/viTh7wlW8/HzJU4YGLRfU qkDrgQfHV0D2TnOw8qjc9ICMfFl4y2/1z1PixRbchefH9DObJS4hlsAKGfOm5TtUS6vyxD iSaoUtzSLFXZBky66UKbiF2rsrK4xK+9Bz/j6b+wics8vxgkdxKyVZpTh41kKw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615445883; a=rsa-sha256; cv=none; b=JFC9U1Z45oWlqJ1BhXsbX9xie8llgHL9NKspV4sE4c/oPXB1EgXECqYO+Z+9tbMJxyVtyL YNK794XDFChdD8HkiIrUpDNIPgqRJJkVoNB/3OlvF4+h6ShHRjymRmNu0XuZc4R0b8BJjY Hrqme+2uj0OYoKZl03GyYJrr6iUzxl5zF54Fsw2TfzmAV+sEauBLhPVCaS5NTWChNkVIVl f+NQdZO9hmsbCuPnjysrgUUPQINyc/tpsS9ofXU7L9jDToo+LJZ4LlB4R6j4w8JQNBTV6I kctPWzJGuJZ1mLLl84vYrU+tqJltW7zFkYS3LCsqIV9Somwi5bn1jVzuSkK8ZQ== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("body hash did not verify") header.d=univ-grenoble-alpes.fr header.s=2020 header.b=XiVHj5jH; dmarc=fail reason="SPF not aligned (relaxed)" header.from=univ-grenoble-alpes.fr (policy=none); spf=pass (aspmx2.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: 0.21 Authentication-Results: aspmx2.migadu.com; dkim=fail ("body hash did not verify") header.d=univ-grenoble-alpes.fr header.s=2020 header.b=XiVHj5jH; dmarc=fail reason="SPF not aligned (relaxed)" header.from=univ-grenoble-alpes.fr (policy=none); spf=pass (aspmx2.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 589B1C3FC X-Spam-Score: 0.21 X-Migadu-Scanner: scn0.migadu.com X-TUID: FkMK4eH/b6AK Hi Simon, Thank you for your answer. Some interface helpers to build a proper = manifest.scm would be appreciated, but this not really my problem here.=20= Just FYI, nix-shell command is the equivalent of guix environment, and = shellHook is the keyword of a particular section in the nix equivalent = of manifest.scm. =20 In fact, what I want to do is: based on a file (like manifest.scm), I = want to describe :=20 - describe inputs of my guix-environment - define a bunch of commands that will be launched in the new shell = created by the guix environment command (e.g. defining env variables). = This is what shellHook does. I hope I am clear. Thank you again. --- Pierre-Antoine Bouttier GriCAD Research Engineer GriCAD - https://gricad.univ-grenoble-alpes.fr/ Batiment IMAG CS 40700 38058 Grenoble CEDEX 9 +33 4 57 42 18 66 > Le 10 mars 2021 =C3=A0 15:07, zimoun a = =C3=A9crit : >=20 > Hi Pierre-Antoine, >=20 > On Tue, 09 Mar 2021 at 17:23, Pierre-Antoine Bouttier = wrote: >=20 >> Do you know if there is any equivalent to shellHook, available for = the >> nix-shell command, for setting up a guix environment through a >> manifest.scm file?=20 >>=20 >> Or maybe another methodology with guix to have approximatively the >> same behavior? (i.e. in a file that can be put under version control, >> defining dependancies and also init commands to set up a guix >> environment)=20 >=20 > I do not know what shellHook and nix-shell are, well I do not know = what > they exactly do so it is hard to answer if an equivalent is there or > not. :-) >=20 > Well, I think some UI and interface is missing here, especially to = have > a manifest containing the inputs of a package. Currently, this ugly: >=20 > --8<---------------cut here---------------start------------->8--- > $ guix environment hello --ad-hoc python -r /tmp/example >=20 > $ guix package --export-manifest -p /tmp/example > ;; This "manifest" file can be passed to 'guix package -m' to = reproduce > ;; the content of your profile. This is "symbolic": it only specifies > ;; package names. To reproduce the exact same profile, you also need = to > ;; capture the channels being used, as returned by "guix describe". > ;; See the "Replicating Guix" section in the manual. >=20 > (specifications->manifest > (list "htop" > "tar" > "gzip" > "bzip2" > "xz" > "file" > "diffutils" > "patch" > "findutils" > "gawk" > "sed" > "grep" > "coreutils" > "make" > "bash-minimal" > "ld-wrapper" > "binutils" > "gcc" > "glibc" > "glibc:static" > "glibc-utf8-locales" > "linux-libre-headers@5.4.20")) > --8<---------------cut here---------------end--------------->8--- >=20 > And what you would like is something like to create a manifest.scm = file > containing all the inputs of the package hello: >=20 > --8<---------------cut here---------------start------------->8--- > (use-modules (guix) > (guix profiles) > (guix scripts environment) > (gnu packages base)) >=20 > (make-manifest (package-environment-inputs hello)) > --8<---------------cut here---------------end--------------->8--- >=20 > but =E2=80=99package-environment-inputs=E2=80=99 is not publicly = exposed. Well, there > is probably other things in the public API doing something similar as > package-environment-inputs. >=20 >=20 > Once you have a profile, you can use it with =E2=80=9Cguix = environment=E2=80=9D and for > example launch it in a container: >=20 > --8<---------------cut here---------------start------------->8--- > $ guix environment -C --profile=3D/tmp/example > --8<---------------cut here---------------end--------------->8--- >=20 > However, there is no clean API to do it at the manifest.scm level. = Ludo > proposed something long time ago but some love for this feature is > missing. :-) And the feature requests popups time to time. :-) >=20 > > >=20 >=20 > Hope that helps, > simon