Thanks very much Kaelyn.

This clarifies things a lot 👏

Tim 


On Wed, 24 May 2023 at 18:17, Kaelyn <kaelyn.alexi@protonmail.com> wrote:

------- Original Message -------
On Wednesday, May 24th, 2023 at 8:25 PM, Timothy Washington <twashing@gmail.com> wrote:


> . This is expected. When you ran the "guix package -L ~/dotfiles/ -m ~/dotfiles/guix/packages/manifest.scm" command above, that not only built the manifest but also
> used the manifest to create a new generation of /home/twashing/.guix-profile.
>
> Ah I see.
>
> . If you run "guix package --list-generations" you should see a list of all of the existing (numbered) generations with the currently active generation marked
> (it's typically the last / latest generation, and should be in this case).
> . Running "guix package -I" will list the packages in the current generation of your default guix profile,
> which should contain the packages in your manifest.
>
> . To go into more details about how profiles work: unless you specify the "-p" argument to "guix package",
> it will operate on your default profile when installing or removing packages (including through using manifests with "-m"),
> and create a new generation when the set of installed packages changes.
>
> . /home/twashing/.guix-profile is a symlink to /var/guix/profiles/per-user/twashing/guix-profile,
> which in turn is a symlink to one of the numbered symlinks in that same /var/guix directory (i.e. if your current generation number is 14, then /var/guix/profiles/per-user/twashing/guix-profile will point to /var/guix/profiles/per-user/twashing/guix-profile-14-link).
>
> . Each of those numbered symlinks points to the actual profile in /gnu/store,
> so using that hypothetical generation 14 as the one created by your "guix package -m" command above,
> /var/guix/profiles/per-user/twashing/guix-profile-14-link would be a symlink to /gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile.
>
> This is really useful for my understanding. Thank-you!
>
> But when I restart my machine, the currently installed tools (from "guix package -i foo") are not available on login.
> For example, I manually ran "guix package -i tree git". And after restarting my machine, those were no longer available, even though presumably they should have been part of my latest generation.
> I do remember trying to load the tools like below. But git and tree were still not available.
> ". /home/twashing/.guix-profile/etc/profile"
>
> Are tools in generations cumulative?

They are when installed or removed via "guix package -i" and "guix package -r". Updating your profile using a manifest is not cumulative--the new generation of your profile will have exactly the set of packages in the manifest. You can then use "guix package -i" and "guix package -r" to modify the installed set, but the set will be reset if/when "guix package -m my-manifest.scm" is run.

> And how can I load the cumulative sum of all my generations, and any custom profiles I create?

The most reproducible way to maintain the set of packages in your default profile is to include them in your manifest (e.g. adding git and tree to the list of packages included in the manifest, then running "guix package -m your-manifest.scm" again). The generations of a profile are like git commits or filesystem snapshots in that they represent the profile at different points in time, and they aren't really meant to be composed together. If you'd like to maintain separate profiles for different sets of packages or groups of functionality instead of installing all the things you need in your default profile, I might recommend taking a look at the Guix Cookbook, in particular https://guix.gnu.org/cookbook/en/html_node/Guix-Profiles-in-Practice.html.

On a different tack, if you have no issue with installing all of the packages you need in a single profile using a manifest, and you'd like a way of managing at least some of your home configuration (shell aliases, simple config files, etc), there is also "guix home" for a declarative way of specify those pieces: https://guix.gnu.org/en/manual/devel/en/html_node/Home-Configuration.html. In a manner of speaking, it is to your home directory what "guix system" is to the OS when booting Guix.

Cheers,
Kaelyn