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/
├── 📁 hosts/ # Host-specific configurations
│ ├── dudumini.nix # Intel Mac configuration
│ ├── dudupro.nix # Apple Silicon Mac configuration
│ └── M137516.nix # Work machine configuration
│
├── 📁 modules/ # Modular configuration components
│ ├── 📁 core/ # Core Nix and system setup
│ │ ├── nix.nix # Nix configuration and settings
│ │ ├── homebrew.nix # Homebrew integration
│ │ └── home-manager.nix # Home Manager setup
│ │
│ ├── 📁 system/ # System-level configurations
│ │ ├── 📁 common/ # Cross-platform system configs
│ │ └── 📁 darwin/ # macOS system settings
│ │ ├── appearance.nix # UI appearance and themes
│ │ ├── dock.nix # Dock configuration
│ │ ├── finder.nix # Finder settings
│ │ ├── keyboard.nix # Keyboard preferences
│ │ ├── security/ # Security and authentication
│ │ └── system.nix # General system settings
│ │
│ ├── 📁 user/ # User-level configurations
│ │ ├── 📁 cli/ # Command-line tools (fzf, direnv, lsd)
│ │ ├── 📁 darwin/ # macOS user applications
│ │ │ ├── 📁 brew/ # User-specific Homebrew packages
│ │ │ ├── 📁 iterm2/ # iTerm2 configuration
│ │ │ ├── 📁 raycast/ # Raycast launcher setup
│ │ │ └── 📁 vscode/ # VS Code configuration
│ │ ├── 📁 git/ # Git and GitHub CLI setup
│ │ └── 📁 shell/ # Shell environment (Zsh, Starship, SSH)
│ │
│ └── 📁 pkgs/ # Custom package definitions
│
├── 📁 profiles/ # User environment bundles
│ ├── emaiax.nix # Personal configuration profile
│ └── eduardo.maia.nix # Work configuration profile
│
├── 📁 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
├── vars.nix # Host and user variable definitions
├── justfile # Task runner commands
└── nix.conf # Nix daemon configuration
/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 protected]"
-
Define the host in
vars.nix
:hosts = { my-new-host = { hostname = "my-new-host"; arch = "aarch64-darwin"; # or "x86_64-darwin" user = users.emaiax; # or users.eduardo }; };
-
Create host-specific configuration:
touch 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.sh
This 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