Dear, On Thu, 18 Jun 2020 at 18:20, elaexuo...@wilsonb.com wrote:
> By `profile', I mean any store output named like /gnu/store/<hash>-profile. > These outputs are created by `guix package' invocations as well as `guix > environment' ones. > > By `user profile', I mean the (non-static) contents pointed to by > ~/.guix-profile. These contents get updated on `guix package' invocations (by > updating the ~/.guix-profile symlink). Well, from my understanding, any profile point to /gnu/store/<hash>-profile. --8<---------------cut here---------------start------------->8--- $ readlink -f ~/.guix-profile /gnu/store/192k3kck2w3g2ms43dry41la9lwrqf37-profile $ guix package -i hello -p /tmp/hello $ readlink -f /tmp/hello /gnu/store/p196x4m6ix33mgsbfacvqaw60129pndw-profile --8<---------------cut here---------------end--------------->8--- > Using this terminology, we both agree than managing your `user profile' via > "manifest.scm" (and "channels.scm") is the way to go. Those two files provide > a > specification which guix *resolves* into a concrete `profile'. > > The imminently practical issue that you, Ludo, and Pierre seem to be working > on > is a way of easing the transition from imperative to declarative `user > profile' > management. > > In contrast, I am proposing making `profiles' first class. By this I mean a > file under /gnu/store/<hash>-profile that contains the code capable of > completely and deterministically rebuilding that exact profile, and that > profile *only*. For which use case? Well, let say there is a profile which could be a mess and I only see two usages currently uncovered: 1. create an environment based on this profile; either to temporarily extend it (which is AFAIK already more or less covered), either to isolate it, 2. pack it for sharing with your colleague. > Just for the sake of argument, let's call this file "recipe.scm", and let's > choose a profile, /gnu/store/123abc-profile. Then the following should be > true: > > $ guix package --manifest /gnu/store/123abc-profile/recipe.scm > $ readlink -f ~/guix-profile > /gnu/store/123abc-profile > > I.e. that `guix package' invocation would have the effect of setting the > current user generation to that exact profile. > > Of course, if we had such a "recipe.scm" then the following would Just Work: > > # Containerize a profile. > $ guix pack --manifest /gnu/store/123abc-profile/recipe.scm > > # Share profiles with your Guix friends. > $ guix environment --manifest ~/downloads/friends-awesome-profile.scm > > And it plays well with potential future features: > > # Copy whole profiles between Guix stores > $ guix archive --manifest /gnu/store/123abc-profile/recipe.scm > > Hopefully my generalized idea is clearer now. What you describe here is exactly what Pierre and other have proposed. And the work-to-do is to prototype the format of what you called "recipe.scm", which means equivalently in the previous emails change the format of <profile>/manifest. All the best, simon