Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

625 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏠 Dotfiles

fast-ci gh-build-status Build

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: Renovate for dependency management, Forgejo Actions for cheap checks, GitHub Actions for the aarch64-darwin build
  • πŸ“¦ Flake-based: Modern Nix flakes for reproducible and composable configurations

πŸ—οΈ Architecture

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
β”‚
β”œβ”€β”€ πŸ“ .forgejo/workflows/        # Self-hosted CI (fmt, flake check, darwin eval)
β”œβ”€β”€ πŸ“ .github/workflows/         # aarch64-darwin build (needs a real macOS runner)
β”‚
β”œβ”€β”€ renovate.json                # Dependency update automation (cross-repo, runs elsewhere)
β”œβ”€β”€ flake.nix                   # Main Nix flake configuration
β”œβ”€β”€ flake.lock                  # Locked dependency versions
β”œβ”€β”€ justfile                    # Task runner commands
└── README.md                   # This file

πŸš€ 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 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
      };
    };
  2. Create host-specific configuration:

    touch nix/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

Development happens on a self-hosted Forgejo instance, which push-mirrors to GitHub:

  • Forgejo (.forgejo/workflows/fast-ci.yml): nix fmt, nix flake check, and an eval-only check of the aarch64-darwin closure β€” cheap, runs on every push/PR
  • GitHub (.github/workflows/build.yml): the actual aarch64-darwin build, on a real macos-15 runner and only on push to main β€” Forgejo has no macOS runner and can't do this itself
  • Forgejo (.forgejo/workflows/gh-build-status.yml): relays build.yml's result back onto the Forgejo commit status. The Forgejo instance is LAN-only, so GitHub's runner can't report back directly β€” this runs the other way instead, polling GitHub's Actions API from a self-hosted runner that has both outbound internet and local access to Forgejo's own API
  • Dependency Updates: Renovate, cross-repo automation that runs from a sibling repo, not a workflow in this one

πŸ—‘οΈ 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

3 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages