A cutting-edge hybrid Linux distribution combining NixOS for system-level configuration and GNU Guix as the primary userspace package manager. This setup provides declarative system management with the flexibility and ideological alignment of GNU Guix.
gunix is a minimal, opinionated system architecture that leverages the strengths of both NixOS and GNU Guix:
- NixOS handles: kernel, bootloader, init system (systemd), networking, GPU drivers, Wayland, SSH, and essential system services
- GNU Guix provides: all userspace packages, fonts, desktop environment (EXWM), user home configuration, and application management
This hybrid approach gives you the reproducibility and declarative nature of functional package managers while maintaining a lean system foundation.
- CachyOS Kernel: Latest high-performance kernel with BORE scheduler and CPU-specific optimizations (x86_64-v3, x86_64-v4, zen4 variants available)
- Minimal NixOS Layer: Only ~50 packages in system closure; Guix handles all userspace applications
- Systemd Integration: Modern init system with socket activation and container support
- LVM Support: Flexible storage management with snapshot capabilities
- EXWM (Emacs X Window Manager): Keyboard-driven Emacs-based window manager for power users
- Wayland Ready: Full support for Wayland sessions with XDG portal integration
- GPU Support: AMD RADV drivers (with Mesa) or NVIDIA support; container passthrough for GPU access
- GNU Guix Home: Declarative user environment with Scheme-based configuration
- Guix Package Manifests: Repeatable environment setup with
manifest.scm - Guix Channels: Pin package versions and use custom package repositories
- Binary Substitutes: Pre-built binaries from ci.guix.gnu.org and bordeaux.guix.gnu.org
- MCP (Model Context Protocol) Integrations: Gemini MCP server for AI-assisted development
- systemd-nspawn Containers: Run full Guix System containers alongside NixOS
- D-Bus Integration: System bus access from containers for seamless communication
- Secret Management: agenix-compatible secrets framework (optional)
- Flake-Based Configuration: NixOS Flakes for reproducible system builds
- First-Boot Scripts: Automated Guix setup during initial system deployment
- SSH Access: Pre-configured OpenSSH with root login disabled
- Emacs + Native Compilation: Full EXWM setup with native-compiled Emacs for performance
- NixOS Live USB: Boot into a NixOS live environment
- Partitions: Create and mount the following (adjust device names as needed):
/dev/sdXN1 → /mnt/boot (EFI, ~500MB) /dev/sdXN2 → /mnt (root, ~50GB+) /dev/sdXN3 → /mnt/home (home, variable size) /dev/sdXN4 → /mnt/gnu (Guix store, ~100GB+)
-
Clone the repository (or extract the tarball):
cd /tmp git clone https://github.com/yourusername/nixos-guix-setup.git cd nixos-guix-setup
-
Review and customize configuration files (optional):
# Edit hostname, timezone, locale, etc. nano configuration.nix nano hardware-configuration.nix -
Run the installer (as root):
sudo ./install.sh
Or for a dry-run to see what will be done:
sudo ./install.sh --dry-run
-
Set root password (after installation):
sudo nixos-enter --root /mnt -- passwd
-
Reboot into the new system:
sudo systemctl reboot
-
Complete Guix setup (on first boot):
# Log in as user 'gux' with password 'o' /root/guix-first-boot.sh -
Configure user Guix home (as user):
guix home reconfigure guix-home.scm
The system will auto-login to the user gux which has a default password of o. We recommend immediately changing this:
passwdThen configure the complete home environment:
guix home reconfigure ~/.config/guix/guix-home.scmnixos-guix-setup/
├── README.md # This file
├── flake.nix # NixOS Flake configuration (inputs & outputs)
├── configuration.nix # Main NixOS system configuration
├── hardware-configuration.nix # Hardware-specific settings (generated or customized)
│
├── Guix Configuration
├── guix-home.scm # Guix Home declarative user environment
├── guix-container.scm # Full Guix System container configuration
├── manifest.scm # Guix package manifest for reproducibility
├── channels.scm # Guix channels (package source configuration)
├── emacs-config.scm # EXWM and Emacs configuration
│
├── Installation & Setup Scripts
├── install.sh # Main installation orchestrator
├── install-guix.sh # Guix binary bootstrapping
├── post-install.sh # Post-installation setup script
├── configure-guix-user.sh # User-level Guix configuration
├── guix-profile.sh # Guix profile initialization
│
├── Integration & Tools
├── gemini-mcp/ # Gemini Model Context Protocol server
│ ├── flake.nix
│ ├── server.py # Python MCP server implementation
│ └── __pycache__/
├── .mcp.json # MCP configuration
├── mcp_import.json # MCP import configuration
│
└── Development
├── .git/ # Git repository metadata
└── .claude/ # Claude Code integration files
Declares NixOS configuration inputs (nixpkgs, CachyOS kernel) and outputs. Creates two configurations: gunix (primary) and nixos-guix (compatibility alias).
Key inputs:
nixpkgs/nixos-unstable- Latest NixOS packagesnix-cachyos-kernel/release- Optimized kernel with pre-built binaries
Primary NixOS system configuration. Structured into sections:
- Boot & Kernel: CachyOS kernel with AMD KVM support
- Networking: Minimal firewall with SSH access
- Services: greetd auto-login, guix-daemon, D-Bus, systemd-nspawn containers
- GPU & Wayland: AMD RADV drivers, Wayland portal support
- Guix Setup: Build users, Guix daemon service, SSL certificate handling
- User Accounts: Default user
guxwith wheel privileges
Declarative user home environment. Configures:
- Zsh shell with completion and theming
- Emacs with EXWM window manager and native compilation
- Git configuration
- SSH key management
- Dotfiles via GNU Stow integration
- Shepherd services for user-level daemons
Repeatable package list for quick environment setup:
- Core utilities (coreutils, findutils, grep, sed, etc.)
- Development tools (git, emacs, vim, etc.)
- Terminal tools (tmux, zoxide, fzf, etc.)
- Language runtimes (python, node.js, rust, etc.)
Guix package channels configuration. Allows:
- Pinning Guix version to specific commit
- Adding custom package repositories
- Version-controlled dependency management
Declarative Emacs configuration in Scheme:
- EXWM window manager setup
- Org-mode, magit, consult integration
- Key bindings and theme configuration
- Native compilation settings
- install.sh: Main orchestrator that handles prerequisites checking, copying configs, running nixos-install, and post-installation Guix setup
- install-guix.sh: Downloads and verifies the Guix binary tarball with GPG signatures
- post-install.sh: Comprehensive post-boot setup including user creation, Guix channel updates, and dotfile management
- configure-guix-user.sh: User-specific Guix configuration helper
- guix-profile.sh: Sources Guix profile for shell initialization
- UEFI → systemd-boot (NixOS)
- CachyOS kernel with AMD KVM and container modules
- systemd starts system services
- greetd displays login prompt
- Auto-login to user
guxexecutes/run/current-system/sw/bin/guix-container-session
The system includes systemd-nspawn container support for running full Guix System instances:
- GPU passthrough via
/dev/dribinding - D-Bus system bus access for IPC
- Full device access (
/devmounted read-write) - Host network sharing
- System packages: Git, curl (minimal NixOS closure)
- User packages: All installed via
guix installormanifest.scm - Environment setup: Guix profile prioritized in PATH before system paths
- SSL certificates: Symlinked from Guix to system locations
Edit configuration.nix and rebuild:
sudo nixos-rebuild switch --flake /etc/nixos#gunix# Update package definitions
guix pull
# Install/upgrade packages
guix install package-name
# Or use manifest for reproducible environments
guix install -m manifest.scmEdit channels.scm to add custom repositories, then:
guix pullEdit emacs-config.scm and reconfigure home:
guix home reconfigure guix-home.scmThe configuration includes optional agenix support for encrypted secrets:
- Generate age keypair:
age-keygen -o - Uncomment agenix import in
configuration.nix - Define secrets:
age.secrets.mysecret.file = ./secrets/mysecret.age
Check logs: journalctl -u guix-daemon -n 50
Ensure guixbuild users exist: getent group guixbuild
Verify /gnu/store is accessible: ls -la /gnu/store
Check D-Bus availability: systemctl status dbus
Confirm XDG portal: systemctl --user status xdg-desktop-portal
Check GPU drivers: glxinfo | grep "OpenGL"
Verify native compilation: emacs --version | grep native
Check .emacs.d/eln-cache/ directory exists and is writable
Verify systemd-networkd: systemctl status systemd-networkd
Check hostname: hostnamectl
Test DNS: nslookup google.com
The configuration uses linuxPackages-cachyos-latest-x86_64-v3. For better performance on supported CPUs:
- x86_64-v4: Latest CPUs (Zen 4, Intel 12th gen+)
- zen4: Optimized for AMD Ryzen 7000 series
- linuxPackages-cachyos-lts: Stable branch with security updates
- linuxPackages-cachyos-bore: Alternative scheduler for responsiveness
Change in configuration.nix:
kernelPackages = pkgs.cachyosKernels."linuxPackages-cachyos-latest-x86_64-v4";Enable substitute downloads from multiple caches:
guix archive --authorize < /path/to/signing-key.pubIncrease parallel builds:
# In environment or ~/.guix-profile/etc/config.scm
(max-jobs 8)This project builds on the excellent work and philosophy of:
-
System Crafters: David Wilson's comprehensive GNU Emacs and Guix Home tutorials. See https://systemcrafters.net/ for their excellent educational content on functional systems and keyboard-driven workflows.
-
GNU Guix Project: For creating a powerful, purely functional package manager with strong ideological roots in free software and reproducibility.
-
NixOS Community: For the declarative system configuration paradigm that inspired Guix's approach.
-
CachyOS Project: For the performance-optimized Linux kernel builds that power this system.
The philosophy behind gunix is to combine the best of both worlds: NixOS's clean system abstraction and CachyOS's performance optimizations, with Guix's freedom-respecting package management and Emacs-based workflows championed by System Crafters.
This configuration is provided as-is for educational and personal use. Please respect the licenses of the projects and software it integrates:
- NixOS (MIT)
- GNU Guix (GPLv3+)
- CachyOS (GPL compatible)
- Emacs (GPLv3+)
For issues specific to this configuration:
- Check the Troubleshooting section above
- Review the comments in
configuration.nixandguix-home.scm - Consult System Crafters documentation: https://systemcrafters.net/
- Ask on GNU Guix forums: https://lists.gnu.org/mailman/listinfo/guix-devel
For Guix-specific questions: https://guix.gnu.org/help/ For NixOS help: https://wiki.nixos.org/
Last Updated: 2026-03-01
Enjoy your declarative, keyboard-driven, freedom-respecting computing experience with gunix!