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@example.com"
-
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