Overview
Home Manager configurations define user-specific settings, applications, and dotfiles. These configurations are stored in the homes/ directory and follow a specific naming pattern.
Naming Patterns
Home Manager profiles use three naming patterns:
1. Global User Configuration
Pattern: homes/username/default.nix
Applies to a user across all systems where they exist:
homes/soriphoono/default.nix
{ pkgs , ... }: {
core = {
secrets = {
enable = true ;
defaultSopsFile = ./secrets.yaml ;
};
git = {
userName = "soriphoono" ;
userEmail = "[email protected] " ;
};
};
userapps . development . editors . neovim . settings = import ./nvim { inherit pkgs ;};
}
2. Host-Specific User Configuration
Pattern: homes/username@hostname/default.nix
Overrides or extends settings for a specific system:
homes/soriphoono@zephyrus/default.nix
{ config , ... }: {
core = {
shells . fish . generateCompletions = true ;
git = {
projectsDir = " ${ config . home . homeDirectory } /Documents/Projects/" ;
extraIdentities = {
school = {
directory = "School" ;
name = "soriphoono" ;
email = "[email protected] " ;
signingKey = "ssh-ed25519 AAAA..." ;
};
work = {
directory = "Work" ;
name = "xrezdev11" ;
email = "[email protected] " ;
signingKey = "ssh-ed25519 AAAA..." ;
};
};
};
};
userapps = {
enable = true ;
browsers = {
chrome . enable = true ;
librewolf . enable = true ;
};
communication = {
discord . enable = true ;
};
data-fortress = {
nextcloud . enable = true ;
bitwarden . enable = true ;
};
office = {
onlyoffice . enable = true ;
};
development = {
enable = true ;
terminal = {
ghostty . enable = true ;
};
knowledge-management . obsidian . enable = true ;
editors = {
neovim . enable = true ;
antigravity . enable = true ;
};
agents = {
gemini = {
enable = true ;
enableJules = true ;
};
};
};
};
}
3. Standalone Home Manager
Pattern: homes/username@global/default.nix
For systems not managed by NixOS (using standalone Home Manager):
homes/user@global/default.nix
{ pkgs , ... }: {
home . stateVersion = "24.05" ;
core = {
git = {
userName = "user" ;
userEmail = "[email protected] " ;
};
};
userapps . browsers . firefox . enable = true ;
}
Configuration Priority
When a user exists on a system, configurations are merged in this order:
homes/username/default.nix (global user config)
homes/username@hostname/default.nix (host-specific overrides)
Host-specific settings override global settings.
Complete Examples
Minimal User
Developer Setup
Host-Specific
A basic configuration with just Git and secrets: homes/spookyskelly/default.nix
{
core = {
secrets = {
enable = true ;
defaultSopsFile = ./secrets.yaml ;
};
git = {
userName = "spookyskelly" ;
userEmail = "[email protected] " ;
};
};
}
A complete development environment: homes/developer@workstation/default.nix
{ config , pkgs , ... }: {
core = {
shells . fish . generateCompletions = true ;
git = {
userName = "developer" ;
userEmail = "[email protected] " ;
projectsDir = " ${ config . home . homeDirectory } /Code" ;
extraIdentities = {
personal = {
directory = "Personal" ;
name = "developer" ;
email = "[email protected] " ;
signingKey = "ssh-ed25519 AAAA..." ;
};
};
};
};
userapps = {
enable = true ;
browsers = {
firefox . enable = true ;
chrome . enable = true ;
};
development = {
enable = true ;
terminal = {
kitty . enable = true ;
ghostty . enable = true ;
};
editors = {
neovim . enable = true ;
vscode . enable = true ;
antigravity . enable = true ;
};
domain_specific . k8s . enable = true ;
agents = {
gemini . enable = true ;
};
};
communication = {
discord . enable = true ;
};
data-fortress = {
bitwarden . enable = true ;
};
};
}
Light configuration on one machine, full setup on another: homes/user@lg-laptop/default.nix
# Minimal setup for laptop
{
core . shells . fish . generateCompletions = true ;
userapps = {
enable = true ;
browsers = {
librewolf . enable = true ;
firefox . enable = true ;
};
};
}
homes/user@workstation/default.nix
# Full development environment
{
core . shells . fish . generateCompletions = true ;
userapps = {
enable = true ;
browsers . chrome . enable = true ;
development = {
enable = true ;
editors . neovim . enable = true ;
terminal . ghostty . enable = true ;
};
office . onlyoffice . enable = true ;
};
}
Core Configuration
Git Configuration
The core.git module provides comprehensive Git setup:
core.git.projectsDir
path
default: "~/Documents/Projects"
Directory where Git projects are stored
Additional Git identities for different contexts (work, school, etc.) Each identity has:
directory - Subdirectory under projectsDir
name - Git user name for this identity
email - Git email for this identity
signingKey - SSH key for commit signing
Multiple Git Identities Example
core . git = {
userName = "soriphoono" ;
userEmail = "[email protected] " ;
projectsDir = " ${ config . home . homeDirectory } /Documents/Projects/" ;
extraIdentities = {
school = {
directory = "School" ;
name = "soriphoono" ;
email = "[email protected] " ;
signingKey = "ssh-ed25519 AAAA..." ;
};
work = {
directory = "Work" ;
name = "professional" ;
email = "[email protected] " ;
signingKey = "ssh-ed25519 AAAA..." ;
};
};
} ;
Projects under ~/Documents/Projects/School/ will use the school identity, while projects under ~/Documents/Projects/Work/ will use the work identity.
Shell Configuration
core.shells.fish.generateCompletions
Generate Fish shell completions for installed packages
core.shells.starship.enable
Enable Starship prompt
core.shells.fastfetch.enable
Enable Fastfetch system info display
Secrets Management
Enable SOPS secrets management
core.secrets.defaultSopsFile
Path to the default SOPS secrets file
User Applications
The userapps namespace provides categorized application modules:
Browsers
userapps . browsers = {
firefox . enable = true ;
librewolf . enable = true ;
floorp . enable = true ;
chrome . enable = true ;
} ;
userapps.browsers.firefox.enable
Install Firefox browser
userapps.browsers.librewolf.enable
Install LibreWolf (privacy-focused Firefox fork)
userapps.browsers.chrome.enable
Install Google Chrome
userapps . development = {
enable = true ;
editors = {
neovim . enable = true ;
vscode . enable = true ;
antigravity . enable = true ;
};
terminal = {
kitty . enable = true ;
ghostty . enable = true ;
warp . enable = true ;
};
knowledge-management . obsidian . enable = true ;
domain_specific . k8s . enable = true ;
agents = {
gemini . enable = true ;
mcp-servers . enable = true ;
};
} ;
userapps.development.editors.neovim.enable
Install Neovim editor
userapps.development.editors.neovim.settings
Custom Neovim configuration (plugins, settings, etc.)
userapps.development.editors.vscode.enable
Install Visual Studio Code
userapps.development.editors.antigravity.enable
Install Antigravity editor
userapps.development.terminal.kitty.enable
Install Kitty terminal emulator
userapps.development.terminal.ghostty.enable
Install Ghostty terminal emulator
userapps.development.domain_specific.k8s.enable
Install Kubernetes tools (kubectl, k9s, helm, etc.)
userapps.development.agents.gemini.enable
Install Google Gemini AI assistant
Communication
userapps . communication = {
discord . enable = true ;
} ;
userapps.communication.discord.enable
Install Discord
Data Fortress (Security)
userapps . data-fortress = {
bitwarden . enable = true ;
nextcloud . enable = true ;
} ;
userapps.data-fortress.bitwarden.enable
Install Bitwarden password manager
userapps.data-fortress.nextcloud.enable
Install Nextcloud client
Office Applications
userapps . office = {
onlyoffice . enable = true ;
} ;
userapps.office.onlyoffice.enable
Install OnlyOffice suite
Advanced Configurations
Custom Neovim Configuration
You can import complex configurations from subdirectories:
{ pkgs , ... }: {
userapps . development . editors . neovim . settings = import ./nvim { inherit pkgs ;};
}
Then create homes/user/nvim/default.nix with your Neovim configuration.
Conditional Configuration
Use Nix expressions for conditional setup:
{ config , lib , ... }: {
userapps . development . editors = {
neovim . enable = true ;
vscode . enable = lib . mkIf ( config . home . username == "developer" ) true ;
};
}
Directory Structure
A complete homes directory might look like:
homes/
├── soriphoono/
│ ├── default.nix # Global config
│ ├── secrets.yaml # Global secrets
│ └── nvim/
│ └── default.nix # Neovim config
├── soriphoono@zephyrus/
│ └── default.nix # Host-specific
├── soriphoono@droid/
│ └── default.nix # Droid-specific
├── spookyskelly/
│ └── default.nix # Global config
└── spookyskelly@lg-laptop/
├── default.nix # Host-specific
└── secrets.yaml # Host secrets
Using Home Manager Modules
All modules from modules/home/ are automatically available:
# These modules are loaded automatically
core . git = { ... } ;
core . shells . fish = { ... } ;
userapps . browsers . firefox = { ... } ;
See the Modules documentation for creating custom modules.
Next Steps
NixOS Systems Configure system-level settings
Modules Learn about available modules
Secrets Manage secrets with SOPS
Nix-on-Droid Configure Android devices