Start the REPL in your flake directory:
repl .
Access home-manager configurations:
homeConfigurations."user@hostname"
Useful aliases for easier access:
cfg = homeConfigurations."user@hostname".config
Access NixOS configurations:
nixosConfigurations.hostname
Useful aliases:
cfg = nixosConfigurations.hostname.config
config
- Contains the evaluated configurationhome
- Basic home configuration (username, homeDirectory, etc.)services
- All service configurationsprograms
- All program configurationssystemd
- Systemd user service configurations
options
- Available configuration optionspkgs
- Access to nixpkgsextendModules
- Function to extend the configurationactivationPackage
- The derivation that activates the configuration
Examples:
# Basic home config
cfg.home.username
cfg.home.homeDirectory
# Services (NOT cfg.home.services)
cfg.services.dunst.enable
cfg.services.picom.enable
# Programs
cfg.programs.git.enable
cfg.programs.vim.enable
config
- Contains the evaluated configurationservices
- System servicessystemd
- Systemd configurationsnetworking
- Network configurationshardware
- Hardware configurations
options
- Available configuration optionspkgs
- Access to nixpkgs
List available attributes:
# List all attributes in a configuration section
builtins.attrNames cfg.services
builtins.attrNames cfg.programs
builtins.attrNames cfg.home
# List all options
builtins.attrNames cfg.options
# Explore specific service options
builtins.attrNames cfg.services.dunst
Error: error: attribute 'xyz' missing
- Check if you're looking in the correct location
- Services are under
config.services
, notconfig.home.services
- Use
builtins.attrNames
to see available attributes
Error messages about removed services (e.g., services.keepassx
) indicate:
- The service has been removed/deprecated
- Often includes information about replacements
- These errors appear when viewing all services but won't affect your configuration
- Press TAB after typing partial paths to see available options
- Works with both attribute names and values
# Check if a service is enabled
cfg.services.dunst.enable
# Check program settings
cfg.programs.git.userEmail
# View entire configuration for a service
cfg.services.dunst
Check if values are being set correctly:
# View the entire configuration
cfg
# View specific sections
cfg.services
cfg.programs
# Check option definitions
cfg.options.services.dunst.enable.description
View flake inputs:
inputs
inputs.nixpkgs
View flake outputs:
outputs
outputs.packages
Package exploration:
# View available packages
builtins.attrNames pkgs
# Check package version
pkgs.nodejs.version
System information:
# NixOS
cfg.networking.hostName
cfg.system.stateVersion
# Home Manager
cfg.home.stateVersion
cfg.home.username