From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Prikler Subject: Re: Collect guix profiles in single directory. Date: Wed, 08 Jan 2020 14:48:39 +0100 Message-ID: <34307ca779925da741af20fa57497c8e13eae7d6.camel@student.tugraz.at> References: <87blrefavb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:51580) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipBhN-0003Xf-KG for guix-devel@gnu.org; Wed, 08 Jan 2020 08:48:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipBhJ-0007Yn-1T for guix-devel@gnu.org; Wed, 08 Jan 2020 08:48:34 -0500 In-Reply-To: <87blrefavb.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: Ludovic =?ISO-8859-1?Q?Court=E8s?= Cc: guix-devel@gnu.org Hi Ludo, Am Mittwoch, den 08.01.2020, 12:25 +0100 schrieb Ludovic Court=C3=A8s: > Hi Leo, >=20 > Leo Prikler skribis: >=20 > > currently, our configuration is (more or less true to XDG) > > scattered > > around various places. Even if one does not make use of more > > advanced > > features, one will at least have two profiles: > > - ~/.config/guix/current > > - ~/.guix-profile > > If one does have more configuration data, the channels.scm must be > > put > > under ~/$XDG_CONFIG_HOME/guix/. Note, that this need not be > > ~/.config/guix, but most likely is. If one wishes to use more than > > one > > profile, so as to keep the build times for each shorter, one has to > > write custom code and can not rely on /etc/profile. > >=20 > > This is a proposal to change the current approach. Instead of > > splitting Guix config in a way that tries to conform to XDG, but > > does > > not really, I propose to use a single directory ~/.guix for all > > configuration. > > This includes: > > - ~/.guix/channels.scm > > - ~/.guix/channels (instead of ~/.guix/current, to match the name > > channels.scm) > > - ~/.guix/profile > > - user-generated profiles >=20 > To me, the most important aspect of your proposal is having all > profiles > in one place (Konrad proposed something similar recently, well, =E2=80=9C= last > year.=E2=80=9D :-)) >=20 > Like I wrote then, =E2=80=98guix package --list-profiles=E2=80=99 was a= n attempt at > making it easier to locate profiles, even if they=E2=80=99re not in the= same > directory, so that you can easily operate on them. What Konrad noted > is > that this returns all the profiles, including > ~/.config/guix/current-kind of profiles, which may be inconvenient. That is certainly a convienient command, although not quite enough for the purpose I had in mind. Perhaps list-profiles could be extended into its own command to allow for more filtering options on the command line, including stuff like =E2=80=98--kind=3D(channel|package)=E2=80=99, = =E2=80=98--prefix=3DDIR=E2=80=99, and so on. > I=E2=80=99m generally wary of enforcing arbitrary conventions, such as = a > specific directory to store all profiles, but at the same time I > agree > that this can be convenient, so I=E2=80=99m a bit split! To be more clear, I do not want ~/.guix to be the ONLY directory where profiles can be stored in. Perhaps the title and initial post were somewhat misleading in that regard. However, I do want ~/.guix to be treated as the directory, where necessary data is put in (i.e. channels and the default profile) and where users can add their own profiles to be treated as if they were the default profile. =20 IOW, when looking at the examples of =E2=80=9CGuix Profiles in Practice=E2= =80=9D, I do not want to have to create ~/.guix-extra-profiles and ~/.guix-extra or ~/.guix-manifests, and neither do I want to set the associated environment variables. Rather, I want ~/.guix to serve both purposes. As an example --8<---------------cut here---------------start------------->8--- for profile in "$GUIX_EXTRA_PROFILES"/*; do guix package --profile=3D"$profile" --manifest=3D"$HOME/.guix- manifests/guix-$profile-manifest.scm" done --8<---------------cut here---------------end--------------->8--- becomes --8<---------------cut here---------------start------------->8--- for profile in $(guix list-profiles --prefix=3D$HOME/.guix -- kind=3Dpackage); do guix package --profile=3D"$profile" --manifest=3D"$profile-manifest.scm= " done --8<---------------cut here---------------end--------------->8--- the latter of which I would personally much prefer. > Also, such a change would need a transition plan: what does =E2=80=98-p= =E2=80=99 > become, etc. Given my above considerations, I would not want to change the behaviour of =E2=80=98-p=E2=80=99. Perhaps one could add a convenience notation fo= r $GUIX_PROFILE_DIR/profile, but given that ~/.guix/profile is not too hard to type, not doing that would probably be the better option. Regards, Leo