manage-profiles.org 2.5 KB

Creating a profile

  1. Create a directory at ${HOME}/.guix-extra-profiles.
  1. Store the following in your ~${HOME}/.profile~:

#+BEGIN_SRC shell # set path for additional profiles for GUIX export GUIX_EXTRA_PROFILES="${HOME}/.guix-extra-profiles" #+END_SRC

  1. Create a manifest file named manifest.scm anywhere accessible, which looks as
  2. follows:

#+BEGIN_SRC scheme (specifications->manifest '("guile@3.0.2" "gnutls")) #+END_SRC

  • This is the complete example content of a manifest file.
  • It does not matter how you name this file, as long as you use its name
  • consistently, throughout the next steps.
  • There is no use-modules or anthing else in that file.
  • Note that versions are denoted via the @x.y.z notation.
  • If no version is needed, just leave the @x.y.z part away.
  1. Then run the following command to actually create the environment, installing
  2. the required packages:

#+BEGIN_SRC shell guix package --manifest="PATH-TO-MANIFEST-CONTAINING-DIR/manifest.scm" --profile="${GUIX_EXTRA_PROFILES}"/example-env #+END_SRC

  • Note, that the directory example-env inside "${GUIX_EXTRA_PROFILES}"
  • must not yet exist for this to work. Otherwise you will get an error telling you something about "Is a directory".
  • This should create the following things:
  • example-env symlink in ${HOME}/.guix-extra-profiles/
  • example-env.lock file in ${HOME}/.guix-extra-profiles/
  • The symlink ${GUIX_EXTRA_PROFILES}/example-env/ should lead to
  • a location, where more files and directories were created, containing the required software. In there should be some ~etc/profile~ file, which is auto-generated and intended to be sourced, to activate the profile.

List profiles

  1. You can list all existing profiles using:

#+BEGIN_SRC shell guix package --list-profiles #+END_SRC

Activate and deactivate profiles

  1. You can activate a profile by running the following commands:

#+BEGIN_SRC shell GUIX_PROFILE="${GUIX_EXTRA_PROFILES}/example-env"; source "${GUIX_PROFILE}/etc/profile" #+END_SRC

  • You can check, whether the profile is active by checking what guile (or
  • another program, that should be installed in the profile) is used:

#+BEGIN_SRC shell which guile #+END_SRC

  1. You can deactivate a profile by closing the terminal emulator.

Deleting profiles

  1. Simply delete the profile directory inside "${GUIX_EXTRA_PROFILES}".