This guide covers common issues and their solutions when using the Nepjua Nix Configuration system.
error: permission denied while building '/nix/store/...'
Solution:
-
Check Nix store permissions:
sudo chown -R root:nixbld /nix/store sudo chmod 1775 /nix/store
-
Verify your user is in the
nixbld
group:sudo usermod -a -G nixbld $USER
error: flake evaluation failed
Solution:
-
Update flake inputs:
nix flake update
-
Check for syntax errors in your configuration
-
Verify all referenced files exist
error: The Homebrew installation at /opt/homebrew does not exist
Solution:
-
Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Verify Homebrew location matches configuration
error: builder for '/nix/store/...' failed with exit code 1
Solution:
-
Clean build:
nix-store --verify --check-contents nix-store --gc
-
Rebuild with verbose output:
nix run nix-darwin -- switch --flake .#$hostname --show-trace
error: collision between new and existing profile
Solution:
-
Remove old generations:
home-manager generations home-manager remove-generations [ID]
-
Force rebuild:
home-manager switch --flake .#$USER@$hostname -b backup
error: collision between packages
Solution:
- Check for duplicate package declarations
- Use
pkgs.hiPrio
for priority packages - Review package overlays
If your system becomes unbootable:
- Boot from recovery mode
- Mount system partitions
- Rebuild using previous generation:
nixos-rebuild switch --rollback
Always keep a backup of working configurations:
- Use Git branches for experiments
- Test changes in a VM first
- Keep known-good generations
-
Enable trace output:
--show-trace
-
Debug builds:
nix-build -K
-
Check derivation:
nix show-derivation
-
Check system logs:
journalctl -xe
-
View service status:
systemctl status service-name
-
Check configuration:
darwin-rebuild check nixos-rebuild dry-build
A: Set up GitHub authentication:
gh auth login
export NIX_CONFIG="extra-access-tokens = github.com=$(gh auth token -u yasinuslu)"
A: Update flake inputs and rebuild:
nix flake update
nixos-rebuild switch --flake .#$hostname # For NixOS
nix run nix-darwin -- switch --flake .#$hostname # For Darwin
A: Use the appropriate command for your system:
sudo nix-collect-garbage -d # System-wide
home-manager expire-generations "-30 days" # Home Manager
If you're still experiencing issues:
- Check the GitHub Issues
- Review the Documentation
- File a new issue with:
- System information
- Error messages
- Steps to reproduce
- Configuration files