Skip to content

Home Manager configuration

The home configuration is modular: a shared base provides common settings, and per-system files override or extend as needed.

Configuration architecture

Base configuration (home/karl/base.nix)

The base configuration contains settings that apply to every system:

  • Core user identity settings
  • Essential directories and files for persistence
  • Common programs and tools
  • Shared environment variables
  • Universal dotfiles and configurations

System-specific configurations

Each system extends the base with overrides:

Config file Target Use case
home/karl/hosts/darth-vader/default.nix Full Linux/NixOS host Daily development
home/karl/r2d2.nix Virtual machines Testing, temporary environments
home/karl/media-server.nix Media server Headless media management
home/karl/hosts/darth-vader/wsl.nix WSL Development on Windows

Usage

NixOS systems (integrated)

For NixOS systems, Home Manager is integrated directly:

# Rebuild system with integrated home-manager
sudo nixos-rebuild switch --flake .#r2d2

Standalone Home Manager

For non-NixOS systems:

# Base configuration (generic)
home-manager switch --flake .#karl@base

# System-specific configurations
home-manager switch --flake .#karl@darth-vader
home-manager switch --flake .#karl@darth-vader-wsl

Configuration inheritance

base.nix (shared foundation)
├── r2d2.nix (VM minimal)
├── darth-vader/default.nix (full host)
└── darth-vader/wsl.nix (WSL specific)

Design notes

  • All systems inherit base.nix, so shared settings stay in one place.
  • Each system can override or extend base settings, including persistence and identity (personal vs. work).
  • macOS configurations exclude impermanence; package sets vary by architecture.
  • The base defaults to the "personal" identity. Work systems override to "work", which swaps SSH keys, Git config, and related settings.

Add a new system

  1. Create system-specific config:
# home/karl/new-system.nix
{...}: {
  imports = [ ./base.nix ];

  # System-specific overrides
  persistence = {
    directories = [
      # Additional directories
    ];
  };
}
  1. Add to flake.nix:
homeConfigurations = {
  "karl@new-system" = home-manager.lib.homeManagerConfiguration {
    pkgs = nixpkgs.legacyPackages.x86_64-linux;
    modules = [ ./home/karl/new-system.nix ];
    extraSpecialArgs = {inherit inputs;};
  };
};
  1. Update CI and testing if the new system needs validation.