Next: , Previous: , Up: Contributing   [Contents][Index]

7.2 Running Guix Before It Is Installed

In order to keep a sane working environment, you will find it useful to test the changes made in your local source tree checkout without actually installing them. So that you can distinguish between your “end-user” hat and your “motley” costume.

To that end, all the command-line tools can be used even if you have not run make install. To do that, prefix each command with ./pre-inst-env (the pre-inst-env script lives in the top build tree of Guix), as in:

$ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild
$ ./pre-inst-env guix build hello

Similarly, for a Guile session using the Guix modules:

$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))'

;;; ("x86_64-linux")

… and for a REPL (see Using Guile Interactively in Guile Reference Manual):

$ ./pre-inst-env guile
scheme@(guile-user)> ,use(guix)
scheme@(guile-user)> ,use(gnu)
scheme@(guile-user)> (define snakes
                         (lambda (package lst)
                           (if (string-prefix? "python"
                                               (package-name package))
                               (cons package lst)
scheme@(guile-user)> (length snakes)
$1 = 361

The pre-inst-env script sets up all the environment variables necessary to support this, including PATH and GUILE_LOAD_PATH.

Note that ./pre-inst-env guix pull does not upgrade the local source tree; it simply updates the ~/.config/guix/latest symlink (see Invoking guix pull). Run git pull instead if you want to upgrade your local source tree.30



If you would like to set up guix to use your Git checkout, you can point the ~/.config/guix/latest symlink to your Git checkout directory. If you are the sole user of your system, you may also consider pointing the /root/.config/guix/latest symlink to point to ~/.config/guix/latest; this way it will always use the same guix as your user does.