unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Gary Johnson <lambdatronic@disroot.org>
To: sebastien.rey-coyrehourcq@univ-rouen.fr
Cc: Tangonov <tn@eml.cc>, Efraim Flashner <efraim@flashner.co.il>,
	help-guix@gnu.org
Subject: Re: Guix home package confusion
Date: Wed, 15 Jun 2022 09:48:54 -0400	[thread overview]
Message-ID: <874k0m57g2.fsf@disroot.org> (raw)
In-Reply-To: <a070f5fc-9911-2dd1-4d20-6e7c0a8fc66f@univ-rouen.fr>

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	other threads:[~2022-06-15 14:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-14 15:05 Guix home package confusion Tangonov
2022-06-14 18:41 ` Efraim Flashner
2022-06-15  3:20   ` Tangonov
2022-06-15  5:38     ` Tangonov
2022-06-15  6:47       ` Sébastien Rey-Coyrehourcq
2022-06-15 13:48         ` Gary Johnson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874k0m57g2.fsf@disroot.org \
    --to=lambdatronic@disroot.org \
    --cc=efraim@flashner.co.il \
    --cc=help-guix@gnu.org \
    --cc=sebastien.rey-coyrehourcq@univ-rouen.fr \
    --cc=tn@eml.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).