Guix Snippets
GNU Guix is a package manager for GNU/Linux systems. Designed to give users more control over their general-purpose and specialized computing environments, and make these easier to reproduce and deploy to multiple devices.
# Install a packageguix install emacs-guix
# Search for a packageguix search icecat
# Remote a packageguix remove emacs-guix
# List installed packagesguix package --list-installed
# List generationsguix package --list-generations
# Update guix revision and package collectionguix pull
# Upgrade packagesguix upgrade
# See current revision informationguix describe
# Install or update Guix systemsudo guix system reconfigure config.scm
# Roll back systemsudo guix system roll-back
# List generationsguix package --list-generations
# Update guix revision and package collectionguix pull
# Upgrade packagesguix upgrade
# See current revision informationguix describe
# Activate guix home configuration in a containerguix home container reconfigure config.scm
# Activate guix home configurationguix home reconfigure config.scm
# Open shell and unset existing environment variables (--pure) with specified manifest file (-m)guix shell --pure -m manifest.scm
# Clean up unused filesguix gc --collect-garbage
# Run specific versions with time-machineguix time-machine --commit=v1.2.0 -- \ environment -C --ad-hoc guide -- guile# Get Guix 1.2.0 and runs guix environment in container called "guile"
# Isolation with --container# Run Antigravity CLI in a Guix sandbox with access to its config and the project directories.# https://whhone.com/posts/switching-to-gnu-guix/agy-guix() { guix shell --container --network --emulate-fhs \ --share="$PWD" \ --share="$HOME/.gemini" \ --share="$HOME/.local/bin" \ --preserve='^(TERM)$' \ coreutils nss-certs bash guix guile emacs git ripgrep fd zip unzip -- $HOME/.local/bin/agy "$@"}Example home configuration in Guix manual
Section titled “Example home configuration in Guix manual”(use-modules (gnu home) (gnu home services) (gnu home services shells) (gnu services) (gnu packages admin) (guix gexp))
(home-environment (packages (list htop)) (services (append (list (service home-bash-service-type (home-bash-configuration (guix-defaults? #t) (variables `(("HISTFILE" . "$XDG_CACHE_HOME/.bash_history") ("HISTSIZE" . "50000")))))
(simple-service 'test-config home-xdg-configuration-files-service-type (list `("test.conf" ,(plain-file "tmp-file.txt" "the content of ~/.config/test.conf"))))) %base-home-services)))