help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guix home package confusion


From: Gary Johnson
Subject: Re: Guix home package confusion
Date: Wed, 15 Jun 2022 09:48:54 -0400

S├ębastien Rey-Coyrehourcq <sebastien.rey-coyrehourcq@univ-rouen.fr> writes:

> Hi,
>
> Happy to see i'm not alone, a little lost when jumping into the guix
> home bath ;)
>
> I think there is something to do (a schema, a table ?) to better
> visualize relation between guix home, guix system, guix install, guix
> package for the beginer. That could help a lot when you start your
> workflow from scratch and you don't know how thing relate each others.
>
> A list with dotfile shared by others, like sqrtminus / dominicm could
> also help (copy / pasting and learning from others).
>
> Best regards
>
> Src

This has been an interesting thread, and I'm glad the OP eventually
worked out a solution for using these tools together.

In my setup, I use these three approaches:

1. guix system

   Installs global packages, runs system services, and creates
   everything in my filesystem outside of /home/$USER.

2. guix home

   Installs local packages for $USER, runs user services, and creates
   all of my dotfiles in /home/$USER, including my shell config files
   (i.e., .bashrc, .bash_profile, .bash_logout).

3. guix package w/ manifests

   Installs local packages for $USER in package groups. For example, I
   place emacs and all of its packages into a manifest called emacs.scm,
   which is installed into my emacs profile. I make similar
   manifest/profile pairs for all the groups of packages on my system.
   Here are my current manifests (chromium, emacs, flatpak, matterhorn,
   media, network, programming, qgis, sysutils, texlive, wine). I then
   have a script that loops over all of my manifests and updates each
   profile whenever I run `guix pull`.

   There are (at least) two advantages to this approach over using `guix
   package` without manifests:

   1. If `guix weather` indicates that no binary substitute exists yet
      for a large package like ungoogled-chromium, qgis, texlive, or
      wine, I can simply upgrade all of my other profiles now and wait
      until a substitute is available before upgrading the large
      package's profile.

   2. If one package fails to build, only its profile doesn't get
      upgraded. All of my other profiles can still be upgraded
      successfully. Then I can go about debugging the broken package at
      my leisure (or wait until the next `guix pull` fixes it) and just
      worry about rebuilding the one upgraded profile at that time.

The main thing to remember when working with Guix is that no matter
which method you use to install a package, it will only be built and
installed once into /gnu/store as long as you are using the same guix
revision (or the same revisions of a particular combination of channels)
and the same package definition.

The different installation commands (guix system, guix home, guix
package) just create your profile directory (containing symlinks back to
/gnu/store) in different places on your filesystem.

To see the packages installed via `guix system`, use this:

  guix package --profile=/var/guix/profiles/system/profile -I

To see the packages installed via `guix home`, use this:

  guix package --profile=$HOME/.guix-home/profile -I

To see the packages installed via `guix package` without manifests, use
this:

  guix package -I

  or if you want to be explicit:

  guix package --profile=$HOME/.guix-profile -I

To see the packages installed via `guix package` with manifests, use
this:

  guix package --profile=$PATH_TO_YOUR_PROFILE -I

Hopefully by now the pattern should be apparent. ;)

The truly IMPORTANT thing to keep in mind when using multiple profiles
is that you have to add them to your login shell's PATH, MANPATH, and
INFOPATH environment variables in order to actually be able to use (and
read documentation about) the packages they contain.

I source the following script in my ~/.bash_profile for this purpose:

```
#!/bin/sh

GUIX_PROFILES=$PATH_TO_YOUR_PROFILES_DIRECTORY

for dir in $GUIX_PROFILES/*
do
    name=$(basename "$dir")
    profile=$dir/$name
    if [ -f "$profile"/etc/profile ]
    then
        GUIX_PROFILE="$profile"
        . "$GUIX_PROFILE"/etc/profile
        export MANPATH="$GUIX_PROFILE/share/man${MANPATH:+:}$MANPATH"
        export INFOPATH="$GUIX_PROFILE/share/info${INFOPATH:+:}$INFOPATH"
    fi
    unset profile
    unset name
done
```

I hope this info helps someone out there improve their Guix
configuration. That's all I've got for now, so have fun and happy
hacking!

~Gary

-- 
GPG Key ID: 7BC158ED
Use `gpg --search-keys lambdatronic' to find me
Protect yourself from surveillance: https://emailselfdefense.fsf.org
=======================================================================
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]