Taking baby steps with Guix (2) : more profiles
Summary
In addition to your default profile ~/.guix-profile
, you can create as many profiles as you want (if you find it useful). For example, I have a profile dedicated to programming with Guile, in which I have installed the latest version of the language, extensions to Emacs, and some libraries I use frequently.
Tell me for which activity would you like to be able to manage software packages with a profile?
In the rest of this article, I consider that you have created a directory dedicated to your profiles (of course, you can choose another name) :
$ mkdir ~/.custom-profile
Create a profile
Guix creates the profiles on demand. It's a transparent mechanism for you. For example, the command below goes :
- create the profile
~/.custom-profile/to-dev
if it doesn't already exist. - download the
hello
package if it is not already in the package repository. - point the profile
~/.custom-profile/to-dev
to thehello
package in the package store.
$ guix --install=hello --profile=${HOME}/.custom-profile/to-dev
Manage profiles
As with the default profile, you can apply the following operations in each of them:
- add
--install
- remove
--move
- update
--upgrade
- lister
--list-installed
To do this, you need to specify the profile in question with the --profile
option.
When you start to get a taste for this feature, the number of profiles quickly becomes significant. Here is the command to get the list of your profiles :
$ guix package --list-profiles
If you feel you no longer need a profile, you can delete it with this command:
$ rm ~/.custom-profile/to-dev*
Using packages from a profile
By default, only the packages installed in your default profile are accessible.
To activate a profile (and thus be able to use the software installed in it), you need to execute the following command:
$ GUIX_PROFILE="${HOME}/.custom-profile/to-dev" \
. "${GUIX_PROFILE}/etc/profile"
Useful links :
Thank you so much for reading this article !
Don't hesitate to give me your opinion, leave a comment, or ask a question via :
– E-mail: jeremy AT korwin-zmijowski DOT fr
– Mastodon: @jeko@framapiaf.org
– Peertube: @jeko@video.tedomum.net
– Twitter: @JeremyKorwin
Also, please subscribe so you don't miss the next ones :
– blog via Mastodon @jeko@write.as et RSS
– screencast via Peertube @jeko@video.tedomum.net et RSS
And most importantly, share the blog and tell your friends it's the best blog in the history of Free Software! No shit!