6

I have just installed GUIX on top of my Arch Linux, however, I still have difficulties to understand some of the concepts. I understand that a profile is a selection of packages from /gnu/store and that I can enable them by sourceing <profile-dir>/etc/profile. However, I don't understand why I seem to have two "default" profiles, stored as symlinks in my home dir:

  • ~/.guix-profile -> /var/guix/profiles/per-user/user/guix-profile
  • ~/.config/guix/current -> /var/guix/profiles/per-user/user/current-guix

I was able to find some information, but not enough:

.guix-profile

You can assign it the role you want. Typically you would install the manifest of the packages you want to use all the time.

Alternatively, you could keep it "manifest-less" for throw-away packages that you would just use for a > couple of days. This way makes it convenient to run guix install package-foo and guix upgrade package-bar (from GUIX cookbook)

.config/guix/current:

The result of running guix pull is a profile available under ~/.config/guix/current containing the latest Guix. ("Invoking guix pull")

What is their difference of these two profiles? Why do I need these two? Do I need to source both on login?

1 Answer 1

7

These profiles are default values

The only things that set these two profiles apart from "normal" GUIX profiles is that they are the default options of their respective GUIX commands (see here for how these two are different):

  • ~/.guix-profile is the default option of the guix package option -p|--profile=
  • ~/.config/guix/current is the default option of the guix pull option -p|--profile=

They're generated on the first call of their respective companion commands if they didn't exist before.

But you can completely do without these two profiles if you wish and use user-defined profiles all the time (see below)

They differ in their jobs: Provide a guix version itself vs. provide other programs managed by guix

  • The profile ~/.config/guix/current provides the binaries guix and guix-daemon. In the default configuration, this profile determines what is the most up-to-date version of all packages you can install. The list of packages you can install is tied to the guix version, in contrary to Nix. This blog post explains why.

    • Concerning the user root, the binary provided by (the symlink target of) /root/.config/guix/current/bin/guix-daemon is the GUIX Daemon that is started automatically by the system. It also has got a symlink in /usr/local/bin.
  • The profile ~/.guix-profile contains any package you want it to contain. Many users include it in their shell startup files, so they have often-used programs that don't belong to any other task-specific profile available automatically.

The profiles are integrated in your workflow only via shell-startup files and you can decide if they are effective

Which profiles are relevant for you is only determined by your .profile (or .bash_profile or whatever shell initialization file you use)

If you specify nothing, you will use no packages from guix and the version of guix itself that root uses, because the GUIX shell installer script creates a symlink /usr/local/bin/guix -> /var/guix/profiles/per-user/root/guix

If you include in your .profile (or similar)1

GUIX_PROFILE=$HOME/.config/guix/current; 
source "$GUIX_PROFILE/etc/profile"

you can use your own version of GUIX and package versions.

If you include

GUIX_PROFILE="$HOME/.guix-profile";
source "$GUIX_PROFILE/etc/profile"

you load a profile which you can define/change without using the -p parameter of guix package. Of course, you can also load any other profile here, you then just have to use the -p parameter if you want to change it. Many people use this profile to include commands they often need but which are not assigned to any task-specific workflow.


1 In case you wonder why you need to define a variable before sourcing, read the source'd script. It will add the link to the profile to $PATH then, and not the profile folder itself. This means that you will automatically get updated package version if you call guix package -u without source'ing the profile again.

3
  • BTW, if I don't use Guix System, what is the proper way to include shell completions for guix command from default profile for guix itself (I mean .config/guix/curret), and from which user it should be taken: myself or root?
    – Anthony
    Sep 12, 2020 at 14:41
  • 1
    Dear @tosh, I don't know that and I think it is more helpful for other users if you create a new question for this, because search engines can find it and you can document there what you already know about your problem, avoiding duplicate work.
    – akraf
    Sep 14, 2020 at 11:36
  • This answer should part of the official documentation! It has puzzled me no end...
    – hmk
    Jul 19 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.