Build errors
Error: attribute 'something' missing
Error: attribute 'something' missing
Symptom:Common causes:
- Referencing a user that doesn’t exist in
garden.system.users - Missing module import
- Typo in attribute path
- Verify the attribute exists in your configuration
- Check that all required modules are imported
- Ensure users are declared in
modules/base/users/options.nix
Error: infinite recursion
Error: infinite recursion
Symptom:Common causes:
- Circular module imports
- Self-referencing option definitions
- Check for circular imports in your module structure
- Use
mkDefault,mkForce, ormkOverrideto break recursion - Review option definitions for self-references
Error: collision between packages
Error: collision between packages
Symptom:Cause: Two packages provide the same binary or file.Solution:
Use
lib.lowPrio or remove one package:Hash mismatch errors
Hash mismatch errors
Symptom:Cause: Flake lock is outdated or corrupted.Solution:
System configuration issues
System doesn't boot after rebuild
System doesn't boot after rebuild
Solution:
- Boot from a previous generation in GRUB
- Check the system log:
- Review recent changes:
- Rebuild with the working configuration:
No users can log in
No users can log in
Symptom: Cannot log in as any user after rebuild.Cause: Users not properly configured or password issues.Solution:
- Boot into recovery mode or single-user mode
- Verify user configuration:
- Reset password:
- Check that user files exist:
/modules/base/users/yourname.nix/modules/nixos/users/yourname.nix
Network not working after boot
Network not working after boot
Solution:
Check NetworkManager status:Enable if disabled:For servers, configure static networking:
Secrets management issues
Error: no key could decrypt the data
Error: no key could decrypt the data
Symptom:Solution:
-
Verify your age key exists:
-
Check your key is in
.sops.yaml: -
Update secret keys:
Secrets not available at runtime
Secrets not available at runtime
Symptom: Service fails because secret file doesn’t exist.Solution:
-
Verify secret is defined:
-
Check secret path:
-
Verify permissions:
Cannot edit secrets
Cannot edit secrets
Symptom:
sops secrets/file.yaml fails.Solution:-
Ensure sops is installed:
-
Set EDITOR environment variable:
-
Check age key exists:
Home-manager issues
Home-manager activation fails
Home-manager activation fails
Symptom:Cause: Conflicting home-manager configurations.Solution:
- Check for duplicate package definitions
- Use
lib.mkForceto override: - Remove conflicting manual installations
XDG directories not created
XDG directories not created
Solution:
Ensure XDG is properly configured:
macOS-specific issues
chmod error on /nix/store
chmod error on /nix/store
Symptom:Cause: Nix doesn’t have Full Disk Access on macOS.Solution:
- Open System Settings → Privacy & Security → Full Disk Access
- Click the + button
- Add
/nix(or the nix daemon) - Run garbage collection again:
Darwin rebuild fails
Darwin rebuild fails
Solution:
- Check nix-darwin is properly installed
- Use the provision script:
- Check homebrew integration if using brew packages
Performance issues
Builds are very slow
Builds are very slow
Solutions:
-
Enable binary cache:
-
Use more cores:
-
Enable parallel building:
Evaluation is slow
Evaluation is slow
Solution:
- Reduce imported modules
- Use
lib.mkDefaultinstead of heavy conditionals - Avoid deep recursion in option definitions
- Profile with:
Debugging techniques
Enable trace messages
Check what’s being built
Inspect configuration
View build logs
Test in VM
Getting help
If you’re still stuck:NixOS Discourse
Community forum for questions and discussions
NixOS Wiki
Community-maintained documentation
GitHub Issues
Report issues specific to this repository
NixOS Manual
Official NixOS documentation
Common debugging commands
Next steps
Making it your own
Customize the configuration
Adding systems
Set up new systems
Secrets management
Configure encrypted secrets
Architecture overview
Understand the architecture