Declarative system configuration using Nix with cross-platform support for macOS
A comprehensive, modular configuration management system built on Nix that provides:
- macOS System Management via Nix-Darwin
- User Environment Configuration via Home Manager
- Package Management via Nix-Homebrew integration
- Multi-Host Support with host-specific configurations
- Multi-User Support with user-specific profiles
- π§ Modular Architecture: Organized into reusable modules for system, user, and host configurations
- π₯οΈ Multi-Host Management: Support for multiple machines with different architectures (Intel/Apple Silicon)
- π₯ Multi-User Support: Separate profiles for personal and work environments
- πΊ Homebrew Integration: Declarative Homebrew package management through Nix
- β‘ Development Tools: Pre-configured CLI tools, shell environment, and development applications
- π¨ macOS Customization: System appearance, dock, finder, and security settings
- π Automated Updates: GitHub Actions for dependency management and build validation
- π¦ Flake-based: Modern Nix flakes for reproducible and composable configurations
dotfiles/
βββ π nix/ # Nix configuration inventory and overrides
β βββ inventory.nix # Host and user variable definitions
β βββ π hosts/ # Host-specific configurations
β β βββ dudumini.nix # Intel Mac configuration
β β βββ dudupro.nix # Apple Silicon Mac configuration
β β
β βββ π profiles/ # User environment bundles and overrides
β βββ emaiax.nix # User configuration profile (emaiax)
β βββ brew.nix # User-specific Homebrew packages
β
βββ π modules/ # Modular configuration components
β βββ π core/ # Core Nix and system setup
β β βββ nix-daemon.nix # Nix runtime and experimental features
β β βββ nixpkgs.nix # Nixpkgs config and overlays
β β βββ system.nix # System-level core config
β β βββ home-manager-setup.nix # Home Manager framework
β β βββ default.nix # Core module imports
β β
β βββ π system/ # System-level configurations
β β βββ π common/ # Cross-platform system configs
β β β βββ default.nix # Environment variables and common settings
β β β
β β βββ π darwin/ # macOS system settings
β β βββ π appearance/ # UI appearance and themes
β β βββ dock.nix # Dock configuration
β β βββ finder.nix # Finder settings
β β βββ keyboard.nix # Keyboard preferences
β β βββ login-window.nix # Login window settings
β β βββ security/ # Security and authentication
β β βββ system.nix # General system settings
β β βββ trackpad.nix # Trackpad preferences
β β βββ default.nix # Darwin module imports
β β
β βββ π user/ # User-level configurations
β β βββ π apps/ # User applications
β β β βββ π iterm2/ # iTerm2 configuration
β β β βββ π raycast/ # Raycast launcher setup
β β β βββ π vscode/ # VS Code configuration
β β βββ π cli/ # Command-line tools (fzf, direnv, lsd)
β β βββ π git/ # Git and GitHub CLI setup
β β βββ π packages/ # Packages and package management
β β β βββ fonts.nix # Font configurations
β β β βββ default.nix # User packages definition
β β βββ π shell/ # Shell environment (Zsh, Starship, SSH)
β β βββ default.nix # User module imports
β β
β βββ π pkgs/ # Custom package definitions
β
βββ π scripts/ # Installation and management scripts
β βββ install.sh # Automated installation script
β βββ uninstall.sh # Clean removal script
β
βββ π .github/ # CI/CD and automation
β βββ workflows/ # GitHub Actions workflows
β βββ dependabot.yml # Automated dependency updates
β
βββ flake.nix # Main Nix flake configuration
βββ flake.lock # Locked dependency versions
βββ justfile # Task runner commands
βββ README.md # This file
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/emaiax/dotfiles/HEAD/scripts/install.sh)"-
Clone the repository:
git clone https://github.com/emaiax/dotfiles.git ~/.dotfiles cd ~/.dotfiles
-
Run the installation script:
./scripts/install.sh
The installation script will:
- Install Xcode Command Line Tools (if needed)
- Install Nix package manager
- Apply the configuration for your system
This project uses just as a task runner for common operations:
# List all available commands
just
# Apply configuration changes
just apply
# Build configuration without applying
just build
# Update all dependencies
just update
# Clean up old generations (>7 days)
just cleanup
# Show system information
just nix-info
# Generate SSH key
just ssh-keygen my-key "email@example.com"-
Define the host in
nix/inventory.nix:hosts = { my-new-host = { hostname = "my-new-host"; arch = "aarch64-darwin"; # or "x86_64-darwin" user = users.emaiax; # or your user key }; };
-
Create host-specific configuration:
touch nix/hosts/my-new-host.nix
-
Apply the configuration:
just apply
- Shell: Zsh with Starship prompt
- File Management:
lsd(modern ls),fzf(fuzzy finder) - Development:
direnv, Git, GitHub CLI - System: SSH configuration and key management
- Terminal: iTerm2 with custom configuration
- Launcher: Raycast for productivity
- Editor: VS Code with extensions
- Package Management: Homebrew integration
- Appearance: Dark mode, accent colors, UI preferences
- Dock: Auto-hide, positioning, and application management
- Finder: Show hidden files, path bar, and view preferences
- Security: Touch ID and Apple Watch authentication
- Keyboard & Trackpad: Custom key mappings and gesture settings
The repository includes automated workflows:
- Build Validation: Tests configuration builds on multiple architectures
- Dependency Updates: Automated updates via Dependabot
- Flake Checking: Validates Nix flake integrity
To completely remove the configuration:
./scripts/uninstall.shThis will:
- Remove Nix and all installed packages
- Clean up system modifications
- Restore original system settings
- Fork the repository
- Create a feature branch
- Make your changes
- Test the configuration builds
- Submit a pull request
This project is open source. Feel free to use and modify as needed.
Built with β€οΈ using Nix