Home Manager allows you to manage user-level configurations independently of system configuration. This is useful for standalone installations on non-NixOS systems or for user-specific settings.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/soriphoono/homelab/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Home Manager configurations are stored in thehomes/ directory with support for three naming patterns:
<user>- Base configuration used everywhere<user>@global- Supplementary config for standalone installs<user>@<hostname>- Machine-specific overrides (integrated with NixOS, not standalone)
Understanding Home Configurations
The flake automatically combines configurations:Standalone Deployment
Deploy Home Manager independently of NixOS systems.Flake Reference Format
Home Manager uses this flake reference format:.refers to the current directory (flake root)#separates the flake reference from the output<username>matcheshomes/<username>orhomes/<username>@global
Configuration Patterns
Base Configuration Only
For users who only need basic settings:Base + Global Configuration
For users who want different settings on NixOS vs. standalone:alice and alice@global are automatically combined.
Base + Machine-Specific
For users on NixOS systems with per-machine customization:Deployment Commands
NixOS Integration
On NixOS systems, Home Manager is integrated automatically through the system configuration.How It Works
The flake includes Home Manager as a NixOS module:System-Integrated Deployment
When deploying a NixOS system, Home Manager configs are applied automatically:- The system configuration from
systems/<hostname>/ - Base home config from
homes/<user>/ - Machine-specific home config from
homes/<user>@<hostname>/(if exists)
First-Time Installation
If Home Manager is not yet installed on your system:Rollback and Recovery
Rollback to Previous Generation
List Generations with Details
Remove Old Generations
Cross-Platform Support
Home Manager works on:- NixOS (integrated or standalone)
- Other Linux distributions
- macOS (Darwin)
- WSL (Windows Subsystem for Linux)
Non-NixOS Linux Example
On Ubuntu, Fedora, Arch, etc.:Configuration Management
System Architecture Detection
The configuration automatically detects system architecture frommeta.nix:
Default Settings
The builder sets sensible defaults:Troubleshooting
File Conflicts
If Home Manager encounters existing files:- Backup and remove the file:
mv ~/.bashrc ~/.bashrc.bak - Home Manager will create
.bakbackups automatically (configured in flake) - Or use
home-manager switch -b backupfor custom backup extension
Permission Issues
Build Failures
- Validate first:
nix flake check - Check for syntax errors in
homes/<username>/default.nix - Verify all referenced modules exist
- Review error messages for missing options
Module Not Found
If custom modules aren’t found:Best Practices
- Keep base configuration minimal and shared
- Use
@globalfor standalone-specific packages - Test on non-critical machines first
- Version control all changes
- Run
nix flake checkbefore deploying - Document complex configurations
Advanced Usage
Update Home Manager
Show Configuration Diff
Manual Activation
Next Steps
- NixOS Systems - Full system deployment
- Nix-on-Droid - Android configurations
- Validation - Pre-deployment checks