* Collect guix profiles in single directory.
@ 2019-12-23 10:59 Leo Prikler
2020-01-06 18:55 ` zimoun
` (3 more replies)
0 siblings, 4 replies; 25+ messages in thread
From: Leo Prikler @ 2019-12-23 10:59 UTC (permalink / raw)
To: guix-devel
Hello Guix,
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.
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
/etc/profile would be rewritten to assume that all subdirectories of
~/.guix are profiles, but loading ~/.guix/channels at last, as is the
current behaviour. In addition, the crucial variables, that are
exported manually for #20255 and #24445 would also have to be taken
into account here.
I think, that these changes would make working with multiple profiles a
lot easier, as all profiles in that directory would then be considered
equal (with the exception of channels). Additionally, a command could
be provided to operate on all profiles at once, to allow cumultative
upgrades, roll-backs, etc. although that might as well be done through
user scripts (that they could also put into ~/.guix).
WDYT?
Regards,
Leo
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2019-12-23 10:59 Collect guix profiles in single directory Leo Prikler
@ 2020-01-06 18:55 ` zimoun
2020-01-06 20:07 ` Alex Griffin
2020-01-07 13:02 ` Leo Prikler
2020-01-06 19:41 ` Pierre Neidhardt
` (2 subsequent siblings)
3 siblings, 2 replies; 25+ messages in thread
From: zimoun @ 2020-01-06 18:55 UTC (permalink / raw)
To: Leo Prikler; +Cc: Guix Devel
Hi,
On Mon, 23 Dec 2019 at 12:00, Leo Prikler <leo.prikler@student.tugraz.at> wrote:
> 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.
Maybe I misread something but instead I would prefer to move
~/.guix-profile under XDG standard, i.e.,
- ~/.config/guix/current (or whatever name remembering it is used by
"guix pull")
- ~/.config/guix/default (or 'profile') playing the role of ~/.guix-profile
Other profiles could be added (by default) under
~/.config/guix/<name-it>. Well, instead of ~/.guix/ I would prefer to
have ~/.config/guix/.
However, I agree that it could be a first step to have Channels
manager (as it was discussed some weeks ago) or Profile manager (also
discussed some weeks ago).
(Personally, I prefer having my profile living in the folders of my
projects, but that another story. ;-)
All the best,
simon
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2019-12-23 10:59 Collect guix profiles in single directory Leo Prikler
2020-01-06 18:55 ` zimoun
@ 2020-01-06 19:41 ` Pierre Neidhardt
2020-01-08 11:25 ` Ludovic Courtès
2020-01-08 11:44 ` Raghav Gururajan
3 siblings, 0 replies; 25+ messages in thread
From: Pierre Neidhardt @ 2020-01-06 19:41 UTC (permalink / raw)
To: Leo Prikler, guix-devel
[-- Attachment #1: Type: text/plain, Size: 149 bytes --]
I like this a lot! Brilliant idea in my opinion.
I agree with Simon on the ~/.config/guix folder.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-06 18:55 ` zimoun
@ 2020-01-06 20:07 ` Alex Griffin
2020-01-06 22:52 ` zimoun
2020-01-07 13:02 ` Leo Prikler
1 sibling, 1 reply; 25+ messages in thread
From: Alex Griffin @ 2020-01-06 20:07 UTC (permalink / raw)
To: guix-devel
I like the idea of collecting guix profiles in one place, and I also like the suggestion to not put it right in $HOME. However, I don't think profiles belong in $XDG_CONFIG_HOME, for the simple reason that they are not configuration. If you really want to follow the xdg basedir spec, they would go in $XDG_DATA_HOME (~/.local/share). Personally, I already keep my profiles in ~/.local/guix, which fits my brain well but is not xdg compliant either.
--
Alex Griffin
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-06 20:07 ` Alex Griffin
@ 2020-01-06 22:52 ` zimoun
0 siblings, 0 replies; 25+ messages in thread
From: zimoun @ 2020-01-06 22:52 UTC (permalink / raw)
To: Alex Griffin; +Cc: Guix Devel
Hi,
On Mon, 6 Jan 2020 at 21:08, Alex Griffin <a@ajgrf.com> wrote:
>
> I like the idea of collecting guix profiles in one place, and I also like the suggestion to not put it right in $HOME. However, I don't think profiles belong in $XDG_CONFIG_HOME, for the simple reason that they are not configuration. If you really want to follow the xdg basedir spec, they would go in $XDG_DATA_HOME (~/.local/share). Personally, I already keep my profiles in ~/.local/guix, which fits my brain well but is not xdg compliant either.
Yes, it make sense to me.
+ ~/.config/guix/current because it is configuration, somehow. Channels too.
+ ~/.local/share/guix for all the other user profiles
And I agree that ~/.local/guix fits better. :-)
But one could also argument that the profiles are configuration and
not data because they are sourced. Well, bikeshedding. ;-)
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
All the best,
simon
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-06 18:55 ` zimoun
2020-01-06 20:07 ` Alex Griffin
@ 2020-01-07 13:02 ` Leo Prikler
1 sibling, 0 replies; 25+ messages in thread
From: Leo Prikler @ 2020-01-07 13:02 UTC (permalink / raw)
To: zimoun; +Cc: Guix Devel
Am Montag, den 06.01.2020, 19:55 +0100 schrieb zimoun:
> Hi,
>
> On Mon, 23 Dec 2019 at 12:00, Leo Prikler <
> leo.prikler@student.tugraz.at> wrote:
>
>
> > 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.
>
> Maybe I misread something but instead I would prefer to move
> ~/.guix-profile under XDG standard, i.e.,
> - ~/.config/guix/current (or whatever name remembering it is used by
> "guix pull")
> - ~/.config/guix/default (or 'profile') playing the role of ~/.guix-
> profile
You didn't really misread anything, my argument for guix "not really"
conforming to XDG standards is twofold:
1. it does not take into account $XDG_CONFIG_DIR, which could (in
theory) be set to something different than ~/.config
2. the current `guix pull` state is not configuration, but data, and as
such would be put into ~/.local/share normally (which is not
preferrable, because of the long typing).
Another suggestion I've heard on IRC was ~/.local/guix as a compromise
between ~/.guix and ~/.local/share/guix. My personal preference is
towards ~/.guix/, as ~/.guix/profile has the same length as ~/.guix-
profile, but again emphasis on the words "personal" and "preference",
meaning I am aware that this is not shared by everyone. Perhaps we can
also use a variable like $GUIX_PROFILE_DIR to indicate where profiles
should be stored. That way, I could set mine under ~/.guix, you could
set yours under ~/.config/guix and XDG purists could set theirs under
$XDG_DATA_HOME/guix.
> (Personally, I prefer having my profile living in the folders of my
> projects, but that another story. ;-)
Project profiles would not go away with this suggestion. It is merely
meant for people, who split their "default profile" over multiple
profiles (for performance reasons or otherwise).
Regards,
Leo
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2019-12-23 10:59 Collect guix profiles in single directory Leo Prikler
2020-01-06 18:55 ` zimoun
2020-01-06 19:41 ` Pierre Neidhardt
@ 2020-01-08 11:25 ` Ludovic Courtès
2020-01-08 13:48 ` Leo Prikler
2020-01-08 11:44 ` Raghav Gururajan
3 siblings, 1 reply; 25+ messages in thread
From: Ludovic Courtès @ 2020-01-08 11:25 UTC (permalink / raw)
To: Leo Prikler; +Cc: guix-devel
Hi Leo,
Leo Prikler <leo.prikler@student.tugraz.at> skribis:
> 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.
>
> 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
To me, the most important aspect of your proposal is having all profiles
in one place (Konrad proposed something similar recently, well, “last
year.” :-))
Like I wrote then, ‘guix package --list-profiles’ was an attempt at
making it easier to locate profiles, even if they’re 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.
I’m 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’m a bit split!
Also, such a change would need a transition plan: what does ‘-p’ become, etc.
Thoughts?
Ludo’.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2019-12-23 10:59 Collect guix profiles in single directory Leo Prikler
` (2 preceding siblings ...)
2020-01-08 11:25 ` Ludovic Courtès
@ 2020-01-08 11:44 ` Raghav Gururajan
3 siblings, 0 replies; 25+ messages in thread
From: Raghav Gururajan @ 2020-01-08 11:44 UTC (permalink / raw)
To: Ludovic Courtès, Leo Prikler; +Cc: guix-devel
Hello Ludo!
> To me, the most important aspect of your proposal is having all profiles
> in one place (Konrad proposed something similar recently, well, “last
> year.” :-))
>
> Like I wrote then, ‘guix package --list-profiles’ was an attempt at
> making it easier to locate profiles, even if they’re 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.
>
> I’m 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’m a bit split!
>
> Also, such a change would need a transition plan: what does ‘-p’ become, etc.
>
> Thoughts?
I just subscribed to guix-devel and happen to see this email.
I had similar thoughts before, that is putting all profiles under single directory.
I was conceptualizing this:
The way we track or mark a particular generations as current generations, I think we can apply same concept to profiles. For example, instead of having 'default-profile' in one directory and others in 'extra-profile' directories; all profiles will be put under one directory. There will be first initial profile '0' created automatically for each user; just like how system generation '0' is created. Then, a user can create as many profiles as they want. It will be tracked as 1, 2, 3 and so on. But here we can a tag something like 'default'. similar to 'current' tag for generations. User can change which profile to be default through `--change-default'; just like '--switch-generation'.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-08 11:25 ` Ludovic Courtès
@ 2020-01-08 13:48 ` Leo Prikler
2020-01-08 14:16 ` Pierre Neidhardt
0 siblings, 1 reply; 25+ messages in thread
From: Leo Prikler @ 2020-01-08 13:48 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel
Hi Ludo,
Am Mittwoch, den 08.01.2020, 12:25 +0100 schrieb Ludovic Courtès:
> Hi Leo,
>
> Leo Prikler <leo.prikler@student.tugraz.at> skribis:
>
> > 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.
> >
> > 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
>
> To me, the most important aspect of your proposal is having all
> profiles
> in one place (Konrad proposed something similar recently, well, “last
> year.” :-))
>
> Like I wrote then, ‘guix package --list-profiles’ was an attempt at
> making it easier to locate profiles, even if they’re 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 ‘--kind=(channel|package)’, ‘--prefix=DIR’,
and so on.
> I’m 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’m 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.
IOW, when looking at the examples of “Guix Profiles in Practice”, 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="$profile" --manifest="$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=$HOME/.guix --
kind=package); do
guix package --profile="$profile" --manifest="$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 ‘-p’
> become, etc.
Given my above considerations, I would not want to change the behaviour
of ‘-p’. Perhaps one could add a convenience notation for
$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
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-08 13:48 ` Leo Prikler
@ 2020-01-08 14:16 ` Pierre Neidhardt
2020-01-30 19:28 ` Pierre Neidhardt
0 siblings, 1 reply; 25+ messages in thread
From: Pierre Neidhardt @ 2020-01-08 14:16 UTC (permalink / raw)
To: Leo Prikler, Ludovic Courtès; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 431 bytes --]
I agree with Leo and to clarify Ludo's concern, I don't think we would
need to "enforce" any directory: it would suffice to make Guix behaviour
more dynamic by automatically scanning some given directories for
profiles.
The scanned directory can easily be configured. This gives us flexibility:
"directory scanning" is an opt-in feature and we keep backward
compatibility.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-08 14:16 ` Pierre Neidhardt
@ 2020-01-30 19:28 ` Pierre Neidhardt
2020-01-30 20:08 ` [ SPAM? ] " Leo Prikler
0 siblings, 1 reply; 25+ messages in thread
From: Pierre Neidhardt @ 2020-01-30 19:28 UTC (permalink / raw)
To: Leo Prikler, Ludovic Courtès; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 883 bytes --]
Proposal:
- Modify /etc/profile in Guix System to load everything in GUIX_PROFILE_DIR if
set. If not set, fall back on ~/.guix-profile.
- When GUIX_PROFILE_DIR is set, use GUIX_PROFILE_DIR/default as the
fault. Otherwise fall back to ~/.guix-profile if GUIX_PROFILE_DIR is
unset for backward compatibility.
- Add a "-P,--profile-name NAME" command line option that automatically derives
the profile path as $GUIX_PROFILE_DIR/$NAME. This would make it easy
to deal with frequently-used profiles from command line, e.g.
guix install -P my-gimpy-profile gimp
In the end, all the user needs to do to start using multiple profiles in
a convenient manner is to export GUIX_PROFILE_DIR.
I believe the above is fully backward compatible. If there is no
objection we can start working on a patch :)
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ SPAM? ] Re: Collect guix profiles in single directory.
2020-01-30 19:28 ` Pierre Neidhardt
@ 2020-01-30 20:08 ` Leo Prikler
2020-01-31 7:59 ` Pierre Neidhardt
0 siblings, 1 reply; 25+ messages in thread
From: Leo Prikler @ 2020-01-30 20:08 UTC (permalink / raw)
To: Pierre Neidhardt, Ludovic Courtès; +Cc: guix-devel
Am Donnerstag, den 30.01.2020, 20:28 +0100 schrieb Pierre Neidhardt:
> Proposal:
>
> - Modify /etc/profile in Guix System to load everything in
> GUIX_PROFILE_DIR if
> set. If not set, fall back on ~/.guix-profile.
Sounds good, but you're missing ordering. Specifically, if
GUIX_PROFILE_DIR is set, I'd want $GUIX_PROFILE_DIR/channels to contain
the channels, that currently live in ~/.config/guix/current, and this
profile's /etc/profile has to be sourced last if we want to have full
backwards compatibility.
By the way, how much would it bite us, if we don't enforce an ordering
here? Would reverse alphabetical order suffice, so that channels are
at least always sourced after default and the user has to take care of
the rest?
> - When GUIX_PROFILE_DIR is set, use GUIX_PROFILE_DIR/default as the
> fault. Otherwise fall back to ~/.guix-profile if GUIX_PROFILE_DIR
> is
> unset for backward compatibility.
s/fault/default/
Also:
- When GUIX_PROFILE_DIR is set, use GUIX_PROFILE_DIR/channels in `guix
pull', falling back to ~/.config/guix/current.
- When GUIX_PROFILE_DIR is set, read channels from
$GUIX_PROFILE_DIR/channels.scm, falling back to
~/.config/guix/channels.scm.
> - Add a "-P,--profile-name NAME" command line option that
> automatically derives
> the profile path as $GUIX_PROFILE_DIR/$NAME. This would make it
> easy
> to deal with frequently-used profiles from command line, e.g.
>
> guix install -P my-gimpy-profile gimp
Could we also make this accept absolute and relative paths (the latter
prefixed with ./) to deprecate `guix environment -r'?
> In the end, all the user needs to do to start using multiple profiles
> in
> a convenient manner is to export GUIX_PROFILE_DIR.
>
> I believe the above is fully backward compatible. If there is no
> objection we can start working on a patch :)
Sounds good to me.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ SPAM? ] Re: Collect guix profiles in single directory.
2020-01-30 20:08 ` [ SPAM? ] " Leo Prikler
@ 2020-01-31 7:59 ` Pierre Neidhardt
2020-01-31 8:46 ` zimoun
2020-01-31 9:18 ` Leo Prikler
0 siblings, 2 replies; 25+ messages in thread
From: Pierre Neidhardt @ 2020-01-31 7:59 UTC (permalink / raw)
To: Leo Prikler, Ludovic Courtès; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 1709 bytes --]
Hi Leo,
About ordering:
1. ~/.config/guix/current is special in that it's the channel of Guix
and it's installed by "guix pull" unlike other channels. Thus I don't
think it belongs to GUIX_PROFILE_DIR. That said, we could introduce
another environment variable for those who want to move it somewhere
else.
2. Indeed profiles should be loaded in a well known order. I suggest to
follow the C alphabetical order. Should "default" be sourced before the
rest? Maybe not. I suggest we leave it to the user at this point.
> - When GUIX_PROFILE_DIR is set, use GUIX_PROFILE_DIR/channels in `guix
> pull', falling back to ~/.config/guix/current.
As suggested above, "guix pull" is quite special. I don't think we
should put it in GUIX_PROFILE_DIR/channels.
> - When GUIX_PROFILE_DIR is set, read channels from
> $GUIX_PROFILE_DIR/channels.scm, falling back to
> ~/.config/guix/channels.scm.
No strong opinion here, we could also leave it to
~/.config/guix/channels.scm. It's a configuration file after all.
>> - Add a "-P,--profile-name NAME" command line option that
>> automatically derives
>> the profile path as $GUIX_PROFILE_DIR/$NAME. This would make it
>> easy
>> to deal with frequently-used profiles from command line, e.g.
>>
>> guix install -P my-gimpy-profile gimp
> Could we also make this accept absolute and relative paths (the latter
> prefixed with ./) to deprecate `guix environment -r'?
Maybe not, since this might raise confusions, e.g. what happens when you
type `-P my-profile` and there is a "my-profile" directory in the
current directory?
Thanks for the feedback!
Cheers!
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ SPAM? ] Re: Collect guix profiles in single directory.
2020-01-31 7:59 ` Pierre Neidhardt
@ 2020-01-31 8:46 ` zimoun
2020-01-31 9:29 ` Leo Prikler
2020-01-31 11:06 ` [ SPAM? ] " Pierre Neidhardt
2020-01-31 9:18 ` Leo Prikler
1 sibling, 2 replies; 25+ messages in thread
From: zimoun @ 2020-01-31 8:46 UTC (permalink / raw)
To: Pierre Neidhardt; +Cc: Guix Devel, Leo Prikler
Hi,
I agree since we have discussed that at the Guix Days. :-)
Thank you for reporting that fast.
On Fri, 31 Jan 2020 at 08:59, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
> 1. ~/.config/guix/current is special in that it's the channel of Guix
> and it's installed by "guix pull" unlike other channels. Thus I don't
> think it belongs to GUIX_PROFILE_DIR. That said, we could introduce
> another environment variable for those who want to move it somewhere
> else.
This environment variable already exists: XDG_CONFIG_HOME, I guess.
See 'config-directory' in utils.scm, used by pull.scm.
> 2. Indeed profiles should be loaded in a well known order. I suggest to
> follow the C alphabetical order. Should "default" be sourced before the
> rest? Maybe not. I suggest we leave it to the user at this point.
By time creation/modification?
In any case, this should be clearly documented. Because it is prone error.
All the best,
simon
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-31 7:59 ` Pierre Neidhardt
2020-01-31 8:46 ` zimoun
@ 2020-01-31 9:18 ` Leo Prikler
2020-01-31 13:33 ` Pierre Neidhardt
1 sibling, 1 reply; 25+ messages in thread
From: Leo Prikler @ 2020-01-31 9:18 UTC (permalink / raw)
To: Pierre Neidhardt, Ludovic Courtès; +Cc: guix-devel
Hi Pierre,
Am Freitag, den 31.01.2020, 08:59 +0100 schrieb Pierre Neidhardt:
> Hi Leo,
>
> About ordering:
>
> 1. ~/.config/guix/current is special in that it's the channel of Guix
> and it's installed by "guix pull" unlike other channels. Thus I
> don't
> think it belongs to GUIX_PROFILE_DIR. That said, we could introduce
> another environment variable for those who want to move it somewhere
> else.
The whole point of this operation was to put everything into one
directory, including profiles managed by `guix pull` rather than `guix
package` -- see the subject line and the initial post.
In the first place, current is not even some piece of configuration
that would warrant putting it into $XDG_CONFIG_DIR or requiring any
other variable, that ends with _CONFIG_DIR. Conceptually it is a
profile like any other.
> 2. Indeed profiles should be loaded in a well known order. I suggest
> to
> follow the C alphabetical order. Should "default" be sourced before
> the
> rest? Maybe not. I suggest we leave it to the user at this point.
If we use reverse alphabetical order, we'll have [z-default), default,
channels, (channels-a], which would mimic the current behaviour.
This is also beneficial when people start prefixing their profiles with
numbers to get deterministic ordering. If p00-foo is loaded after p01-
bar, the paths it sets will be so that p00-foo appears first.
> > - When GUIX_PROFILE_DIR is set, use GUIX_PROFILE_DIR/channels in
> > `guix
> > pull', falling back to ~/.config/guix/current.
>
> As suggested above, "guix pull" is quite special. I don't think we
> should put it in GUIX_PROFILE_DIR/channels.
As discussed above.
> > - When GUIX_PROFILE_DIR is set, read channels from
> > $GUIX_PROFILE_DIR/channels.scm, falling back to
> > ~/.config/guix/channels.scm.
>
> No strong opinion here, we could also leave it to
> ~/.config/guix/channels.scm. It's a configuration file after all.
Fair enough, but I'd also like $GUIX_PROFILE_DIR to be a place where
users can store their manifests and other specifications. Hence
loading channels.scm from there first (if it exists) sounds like a good
idea.
> Maybe not, since this might raise confusions, e.g. what happens when
> you
> type `-P my-profile` and there is a "my-profile" directory in the
> current directory?
My bad, I forgot, that lowercase `-p` will still exist. Now that I
think about it, is -P my-profile really that much better than -p
$GUIX_PROFILE_DIR/my-profile? I personally believe explicit to be
better here.
Regards,
Leo
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-31 8:46 ` zimoun
@ 2020-01-31 9:29 ` Leo Prikler
2020-01-31 12:04 ` Pierre Neidhardt
2020-01-31 11:06 ` [ SPAM? ] " Pierre Neidhardt
1 sibling, 1 reply; 25+ messages in thread
From: Leo Prikler @ 2020-01-31 9:29 UTC (permalink / raw)
To: zimoun, Pierre Neidhardt; +Cc: Guix Devel
Hi,
Am Freitag, den 31.01.2020, 09:46 +0100 schrieb zimoun:
> Hi,
>
> I agree since we have discussed that at the Guix Days. :-)
> Thank you for reporting that fast.
>
>
> On Fri, 31 Jan 2020 at 08:59, Pierre Neidhardt <mail@ambrevar.xyz>
> wrote:
>
> > 1. ~/.config/guix/current is special in that it's the channel of
> > Guix
> > and it's installed by "guix pull" unlike other channels. Thus I
> > don't
> > think it belongs to GUIX_PROFILE_DIR. That said, we could
> > introduce
> > another environment variable for those who want to move it
> > somewhere
> > else.
>
> This environment variable already exists: XDG_CONFIG_HOME, I guess.
> See 'config-directory' in utils.scm, used by pull.scm.
The thing with XDG_CONFIG_HOME and config-directory is, that it doesn't
allow me to set config-directory directly AND requires all other
configuration to be put in the new XDG_CONFIG_HOME as well. I
personally wouldn't mind reading all profiles from config-directory,
but I would like a way to set that to ~/.guix.
> By time creation/modification?
mtime will cause weird bugs if you do single upgrades of profiles.
ctime may be acceptable, depending on how familiar one is with touch,
but I'd personally prefer reverse alphabetical because it is the
easiest to understand.
All the best,
Leo
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [ SPAM? ] Re: Collect guix profiles in single directory.
2020-01-31 8:46 ` zimoun
2020-01-31 9:29 ` Leo Prikler
@ 2020-01-31 11:06 ` Pierre Neidhardt
1 sibling, 0 replies; 25+ messages in thread
From: Pierre Neidhardt @ 2020-01-31 11:06 UTC (permalink / raw)
To: zimoun; +Cc: Guix Devel, Leo Prikler
[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]
zimoun <zimon.toutoune@gmail.com> writes:
>> 1. ~/.config/guix/current is special in that it's the channel of Guix
>> and it's installed by "guix pull" unlike other channels. Thus I don't
>> think it belongs to GUIX_PROFILE_DIR. That said, we could introduce
>> another environment variable for those who want to move it somewhere
>> else.
>
> This environment variable already exists: XDG_CONFIG_HOME, I guess.
> See 'config-directory' in utils.scm, used by pull.scm.
Thanks for checking!
>> 2. Indeed profiles should be loaded in a well known order. I suggest to
>> follow the C alphabetical order. Should "default" be sourced before the
>> rest? Maybe not. I suggest we leave it to the user at this point.
>
> By time creation/modification?
Any particular reason? I'm not sure this is a good approach because it
would entail that the order would change depending on the user
interaction with the profile. For instance, with profiles A and B, A
comes before B, if I update B then B would come before A.
Thoughts?
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-31 9:29 ` Leo Prikler
@ 2020-01-31 12:04 ` Pierre Neidhardt
2020-01-31 12:56 ` Leo Prikler
0 siblings, 1 reply; 25+ messages in thread
From: Pierre Neidhardt @ 2020-01-31 12:04 UTC (permalink / raw)
To: Leo Prikler, zimoun; +Cc: Guix Devel
[-- Attachment #1: Type: text/plain, Size: 886 bytes --]
> The thing with XDG_CONFIG_HOME and config-directory is, that it doesn't
> allow me to set config-directory directly AND requires all other
> configuration to be put in the new XDG_CONFIG_HOME as well. I
> personally wouldn't mind reading all profiles from config-directory,
> but I would like a way to set that to ~/.guix.
Make sense, we need to define a GUIX_CONFIG_HOME that expands to
XDG_CONFIG_HOME/guix by default.
>> By time creation/modification?
> mtime will cause weird bugs if you do single upgrades of profiles.
> ctime may be acceptable, depending on how familiar one is with touch,
> but I'd personally prefer reverse alphabetical because it is the
> easiest to understand.
To be clear, I think we need to speak in terms of priority: should "a"
have higher priority than "z" or the other way around?
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-31 12:04 ` Pierre Neidhardt
@ 2020-01-31 12:56 ` Leo Prikler
2020-01-31 13:36 ` Pierre Neidhardt
0 siblings, 1 reply; 25+ messages in thread
From: Leo Prikler @ 2020-01-31 12:56 UTC (permalink / raw)
To: Pierre Neidhardt, zimoun; +Cc: Guix Devel
On Fri, 2020-01-31 at 13:04 +0100, Pierre Neidhardt wrote:
> > The thing with XDG_CONFIG_HOME and config-directory is, that it
> > doesn't
> > allow me to set config-directory directly AND requires all other
> > configuration to be put in the new XDG_CONFIG_HOME as well. I
> > personally wouldn't mind reading all profiles from config-
> > directory,
> > but I would like a way to set that to ~/.guix.
>
> Make sense, we need to define a GUIX_CONFIG_HOME that expands to
> XDG_CONFIG_HOME/guix by default.
Which would mean adding an (override #f) to xdg-directory and adding
#:override (getenv "GUIX_CONFIG_HOME") to config-directory.
Then we'd only have to move ~/.guix-profile to (config-
directory)/default and rename current to channels.
What would we do for backwards compatibility in this case? Keep the
~/.guix-profile and (config-directory)/current symlink until the user
removes it, perhaps sourcing them twice?
> > > By time creation/modification?
> > mtime will cause weird bugs if you do single upgrades of profiles.
> > ctime may be acceptable, depending on how familiar one is with
> > touch,
> > but I'd personally prefer reverse alphabetical because it is the
> > easiest to understand.
>
> To be clear, I think we need to speak in terms of priority: should
> "a"
> have higher priority than "z" or the other way around?
"z" before "a". Guix profiles prepend paths, so the result will have
e.g. a/bin:z/bin.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-31 9:18 ` Leo Prikler
@ 2020-01-31 13:33 ` Pierre Neidhardt
2020-01-31 14:34 ` Leo Prikler
0 siblings, 1 reply; 25+ messages in thread
From: Pierre Neidhardt @ 2020-01-31 13:33 UTC (permalink / raw)
To: Leo Prikler, Ludovic Courtès; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]
Leo Prikler <leo.prikler@student.tugraz.at> writes:
> Hi Pierre,
>
> Am Freitag, den 31.01.2020, 08:59 +0100 schrieb Pierre Neidhardt:
>> Hi Leo,
>>
>> About ordering:
>>
>> 1. ~/.config/guix/current is special in that it's the channel of Guix
>> and it's installed by "guix pull" unlike other channels. Thus I
>> don't
>> think it belongs to GUIX_PROFILE_DIR. That said, we could introduce
>> another environment variable for those who want to move it somewhere
>> else.
> The whole point of this operation was to put everything into one
> directory, including profiles managed by `guix pull` rather than `guix
> package` -- see the subject line and the initial post.
Yes, but I propose to go even more general: Have a configuration knob
for all files, so that everyone is free to move stuff anywhere they want.
> Conceptually it is a profile like any other.
But practically I suspect that most users will deal with it specially.
It would be nice to be able to make the distinction between the "guix"
profile and the rest.
> My bad, I forgot, that lowercase `-p` will still exist. Now that I
> think about it, is -P my-profile really that much better than -p
> $GUIX_PROFILE_DIR/my-profile? I personally believe explicit to be
> better here.
Indeed, we can leave this option out for now if it's too superfluous.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-31 12:56 ` Leo Prikler
@ 2020-01-31 13:36 ` Pierre Neidhardt
0 siblings, 0 replies; 25+ messages in thread
From: Pierre Neidhardt @ 2020-01-31 13:36 UTC (permalink / raw)
To: Leo Prikler, zimoun; +Cc: Guix Devel
[-- Attachment #1: Type: text/plain, Size: 344 bytes --]
Leo Prikler <leo.prikler@student.tugraz.at> writes:
>> To be clear, I think we need to speak in terms of priority: should
>> "a"
>> have higher priority than "z" or the other way around?
> "z" before "a". Guix profiles prepend paths, so the result will have
> e.g. a/bin:z/bin.
OK.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-31 13:33 ` Pierre Neidhardt
@ 2020-01-31 14:34 ` Leo Prikler
2020-01-31 15:17 ` Pierre Neidhardt
0 siblings, 1 reply; 25+ messages in thread
From: Leo Prikler @ 2020-01-31 14:34 UTC (permalink / raw)
To: Pierre Neidhardt, Ludovic Courtès; +Cc: guix-devel
Am Freitag, den 31.01.2020, 14:33 +0100 schrieb Pierre Neidhardt:
> Leo Prikler <leo.prikler@student.tugraz.at> writes:
>
> > Hi Pierre,
> >
> > Am Freitag, den 31.01.2020, 08:59 +0100 schrieb Pierre Neidhardt:
> > > Hi Leo,
> > >
> > > About ordering:
> > >
> > > 1. ~/.config/guix/current is special in that it's the channel of
> > > Guix
> > > and it's installed by "guix pull" unlike other channels. Thus I
> > > don't
> > > think it belongs to GUIX_PROFILE_DIR. That said, we could
> > > introduce
> > > another environment variable for those who want to move it
> > > somewhere
> > > else.
> > The whole point of this operation was to put everything into one
> > directory, including profiles managed by `guix pull` rather than
> > `guix
> > package` -- see the subject line and the initial post.
>
> Yes, but I propose to go even more general: Have a configuration knob
> for all files, so that everyone is free to move stuff anywhere they
> want.
What do you mean by that exactly? One knob for everything as with
config-directory? Several knobs for several things? One knob per file
or directory? Which knob will do what?
> > Conceptually it is a profile like any other.
>
> But practically I suspect that most users will deal with it
> specially.
> It would be nice to be able to make the distinction between the
> "guix"
> profile and the rest.
But why is it, that most people deal with it specially and to which
extent do they do so? Personally, I can see two big differences:
1. The usage of a different command to populate it.
2. A different config file style (channels.scm over manifest.scm).
Other than that, you could maybe cite the fact, that you don't want the
guix command installed in any other profile, but that's about it.
Even accepting a distinction, there is nothing inside that distinction,
that would enforce a separation in storage -- at least as far as I see
it. Before you even get to the point of user profiles, guix system
puts the guix command together with everything else into the system
profile, so it's not even an issue until you try to `guix install guix`
despite commonly shared advice on IRC telling you not to.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-31 14:34 ` Leo Prikler
@ 2020-01-31 15:17 ` Pierre Neidhardt
2020-01-31 15:38 ` Leo Prikler
0 siblings, 1 reply; 25+ messages in thread
From: Pierre Neidhardt @ 2020-01-31 15:17 UTC (permalink / raw)
To: Leo Prikler, Ludovic Courtès; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 984 bytes --]
Leo Prikler <leo.prikler@student.tugraz.at> writes:
> What do you mean by that exactly? One knob for everything as with
> config-directory? Several knobs for several things? One knob per file
> or directory? Which knob will do what?
Sorry, that was confusing: I'm suggesting we have one knob per file.
> Even accepting a distinction, there is nothing inside that distinction,
> that would enforce a separation in storage -- at least as far as I see
> it. Before you even get to the point of user profiles, guix system
> puts the guix command together with everything else into the system
> profile, so it's not even an issue until you try to `guix install guix`
> despite commonly shared advice on IRC telling you not to.
I think your points are strong enough arguments to keep them separate.
I can understand why someone would not. In the end, the best option is
probably to leave it to the user to choose.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-31 15:17 ` Pierre Neidhardt
@ 2020-01-31 15:38 ` Leo Prikler
2020-01-31 15:52 ` Pierre Neidhardt
0 siblings, 1 reply; 25+ messages in thread
From: Leo Prikler @ 2020-01-31 15:38 UTC (permalink / raw)
To: Pierre Neidhardt, Ludovic Courtès; +Cc: guix-devel
Am Freitag, den 31.01.2020, 16:17 +0100 schrieb Pierre Neidhardt:
> Leo Prikler <leo.prikler@student.tugraz.at> writes:
>
> > What do you mean by that exactly? One knob for everything as with
> > config-directory? Several knobs for several things? One knob per
> > file
> > or directory? Which knob will do what?
>
> Sorry, that was confusing: I'm suggesting we have one knob per file.
So in that case I'd have to set
- GUIX_PROFILE_DIR,
- GUIX_PULL_DIR, and
- GUIX_CHANNELS_FILE (or alternatively GUIX_CONFIG_DIR)
just so everything is in one place? Sounds a bit overkill to me.
Could we make GUIX_PROFILE_DIR and GUIX_PULL_DIR default to
GUIX_CONFIG_DIR in the (very likely) case that everything should be put
into the same directory?
> > Even accepting a distinction, there is nothing inside that
> > distinction,
> > that would enforce a separation in storage -- at least as far as I
> > see
> > it. Before you even get to the point of user profiles, guix system
> > puts the guix command together with everything else into the system
> > profile, so it's not even an issue until you try to `guix install
> > guix`
> > despite commonly shared advice on IRC telling you not to.
>
> I think your points are strong enough arguments to keep them
> separate.
How so?
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: Collect guix profiles in single directory.
2020-01-31 15:38 ` Leo Prikler
@ 2020-01-31 15:52 ` Pierre Neidhardt
0 siblings, 0 replies; 25+ messages in thread
From: Pierre Neidhardt @ 2020-01-31 15:52 UTC (permalink / raw)
To: Leo Prikler, Ludovic Courtès; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 789 bytes --]
Leo Prikler <leo.prikler@student.tugraz.at> writes:
> So in that case I'd have to set
> - GUIX_PROFILE_DIR,
> - GUIX_PULL_DIR, and
> - GUIX_CHANNELS_FILE (or alternatively GUIX_CONFIG_DIR)
> just so everything is in one place? Sounds a bit overkill to me.
> Could we make GUIX_PROFILE_DIR and GUIX_PULL_DIR default to
> GUIX_CONFIG_DIR in the (very likely) case that everything should be put
> into the same directory?
Absolutely, we can default the other variables to GUIX_CONFIG_DIR (or
whatever we like better).
>> I think your points are strong enough arguments to keep them
>> separate.
> How so?
Just my feeling about it, it's quite subjective I suppose. Which is why
I'd rather leave the choice to the user.
--
Pierre Neidhardt
https://ambrevar.xyz/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2020-01-31 15:52 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-23 10:59 Collect guix profiles in single directory Leo Prikler
2020-01-06 18:55 ` zimoun
2020-01-06 20:07 ` Alex Griffin
2020-01-06 22:52 ` zimoun
2020-01-07 13:02 ` Leo Prikler
2020-01-06 19:41 ` Pierre Neidhardt
2020-01-08 11:25 ` Ludovic Courtès
2020-01-08 13:48 ` Leo Prikler
2020-01-08 14:16 ` Pierre Neidhardt
2020-01-30 19:28 ` Pierre Neidhardt
2020-01-30 20:08 ` [ SPAM? ] " Leo Prikler
2020-01-31 7:59 ` Pierre Neidhardt
2020-01-31 8:46 ` zimoun
2020-01-31 9:29 ` Leo Prikler
2020-01-31 12:04 ` Pierre Neidhardt
2020-01-31 12:56 ` Leo Prikler
2020-01-31 13:36 ` Pierre Neidhardt
2020-01-31 11:06 ` [ SPAM? ] " Pierre Neidhardt
2020-01-31 9:18 ` Leo Prikler
2020-01-31 13:33 ` Pierre Neidhardt
2020-01-31 14:34 ` Leo Prikler
2020-01-31 15:17 ` Pierre Neidhardt
2020-01-31 15:38 ` Leo Prikler
2020-01-31 15:52 ` Pierre Neidhardt
2020-01-08 11:44 ` Raghav Gururajan
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).