Using GNU Guix on Parabola - ParabolaWiki

# Using GNU Guix on Parabola

GNU Guix is a package manager.

To use it on Parabola, make sure you install the guix package (with pacman -S guix) and run the following commands (more detail in the official documentation) as root:

    groupadd --system guixbuild
    # for i in `seq -w 1 10`;
      do
        useradd -g guixbuild -G guixbuild           \
                -d /var/empty -s `which nologin`    \
                -c "Guix build user $i" --system    \
                guixbuilder$i;
      done

Then, run:

    # systemctl enable guix-daemon
    # systemctl start guix-daemon

## Configuring guix

### Enabling binary packages

To enable binary pacakges do:

    guix archive --authorize < /usr/share/guix/hydra.gnu.org.pub

The official documentation has more information on it.

Make sure to read at least the official section about the (security) implications of enabling binary packages.

After that, you should be able to use Guix normally.

### Not using /tmp

/tmp is by default configured to use at maximum 50% of the RAM, and guix uses /tmp it by default. Because of that, it might not be suitable for machines not having a lot of RAM.

To fix it, first create the respective temporary directory, as root, on your disk:

    # mkdir /gnu/tmp
    # chown root:guixbuild /gnu/tmp

Then override the systemd unit for guix-daemon:

    # cp /lib/systemd/system/guix-daemon.service /etc/systemd/system/

Add the following line to it to change the temporary directory location:

    Environment="TMPDIR=/gnu/tmp"

Like this:

    # This is a "service unit file" for the systemd init system to launch
    # 'guix-daemon'.  Drop it in /etc/systemd/system or similar to have
    # 'guix-daemon' automatically started.

    [Unit]
    Description=Build daemon for GNU Guix

    [Service]
    Environment="TMPDIR=/gnu/tmp"
    ExecStart=/usr/bin/guix-daemon --build-users-group=guixbuild
    RemainAfterExit=yes
    StandardOutput=syslog
    StandardError=syslog

    [Install]
    WantedBy=multi-user.target

Note that even if it doesn't use /tmp anymore (you can verify it by doing `ls /tmp/guix-*`) it will continue to show up in build logs, as explained in the official documentation. `ls /gnu/tmp/guix-*` will however contain temporary directory used by guix.

Category:

- Software