Skip to content

β„οΈπŸ’» setup configurations for nix, nix-darwin and home-manager

Notifications You must be signed in to change notification settings

emaiax/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏠 Dotfiles

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

✨ Features

  • πŸ”§ 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

πŸ—οΈ Architecture

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

πŸš€ Quick Start

One-Line Installation

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/emaiax/dotfiles/HEAD/scripts/install.sh)"

Manual Installation

  1. Clone the repository:

    git clone https://github.com/emaiax/dotfiles.git ~/.dotfiles
    cd ~/.dotfiles
  2. 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

πŸ”§ Usage

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"

Adding a New Host

  1. 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
      };
    };
  2. Create host-specific configuration:

    touch hosts/my-new-host.nix
  3. Apply the configuration:

    just apply

πŸ› οΈ Included Tools & Applications

Command Line Tools

  • Shell: Zsh with Starship prompt
  • File Management: lsd (modern ls), fzf (fuzzy finder)
  • Development: direnv, Git, GitHub CLI
  • System: SSH configuration and key management

macOS Applications

  • Terminal: iTerm2 with custom configuration
  • Launcher: Raycast for productivity
  • Editor: VS Code with extensions
  • Package Management: Homebrew integration

System Customization

  • 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

πŸ”„ Continuous Integration

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

πŸ—‘οΈ Uninstallation

To completely remove the configuration:

./scripts/uninstall.sh

This will:

  • Remove Nix and all installed packages
  • Clean up system modifications
  • Restore original system settings

πŸ“š Learning Resources

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test the configuration builds
  5. Submit a pull request

πŸ“„ License

This project is open source. Feel free to use and modify as needed.


Built with ❀️ using Nix

About

β„οΈπŸ’» setup configurations for nix, nix-darwin and home-manager

Topics

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •