Guix

Table of Contents

1. Guix

1.1. Cleaning up

sudo guix system delete-generations
guix gc -d

To find what's taking space in /gnu/store/:

ls -1 /gnu/store/ | sed 's|^|/gnu/store/|' | xargs -n 10000 du -hs | sort -h

To find the gc roots:

guix gc --list-roots

1.2. Build guix from source

https://guix.gnu.org/manual/en/html_node/Building-from-Git.html

git clone https://git.savannah.gnu.org/git/guix.git
cd guix
echo $PWD >> ~/.config/guix/shell-authorized-directories
guix shell # OR guix shell-D guix --pure
./bootstrap
./configure --localstatedir=/var
make
./pre-inst-env scripts/guix describe

1.3. How to build a package from a clone of guix?

./pre-inst-env scripts/guix build hello

1.4. guix/maintenance.git

Repository meant to contain documents and tools by Guix hackers and maintainers that do not fit in the Guix repository.

guix/maintenance.git

1.5. Cuirass

Cuirass is a continuous integration tool for Guix. It can be used both for development and for providing substitutes to others.

1.6. Running nix on guix

  1. add the service (service nix-service-type)
  2. install the package nix
  3. add a channel e.g. nix-channel --add https://nixos.org/channels/nixos-24.05
  4. nix-channel --update
  5. ln -s "/nix/var/nix/profiles/per-user/$USER/profile" ~/.nix-profile
  6. source /run/current-system/profile/etc/profile.d/nix.fish
  7. Create missing directories sudo mkdir -m 0755 -p /nix/var/nix/{profiles,gcroots}/per-user/$USER
  8. Give the directories the right owners sudo chown -R $USER:nixbld /nix/var/nix/profiles/per-user/$USER

2. Related notes

3. Backlinks

Created: 2025-03-20 Thu 01:16