A declarative, reproducible, and modular macOS configuration using Nix Darwin, Home Manager, and Homebrew.
Features • Quick Start • Structure • Usage
|
|
|
|
- macOS (Apple Silicon or Intel)
- Nix with flakes enabled
- Git for cloning this repository
# 1. Clone this configuration
git clone https://github.com/nyxsr/nix-darwin ~/.config/nix-darwin
cd ~/.config/nix-darwin
# 2. Apply the configuration
darwin-rebuild switch --flake .#sahrulramdan
# 3. Reload your shell
exec zsh~/.config/nix-darwin/
│
├── 📄 flake.nix # Entry point & system definition
├── 🏠 home.nix # Home Manager configuration
│
├── 🍎 darwin/ # System-level configurations
│ ├── base-packages.nix # Core system tools
│ ├── fonts.nix # Developer fonts
│ ├── homebrew.nix # Homebrew packages & apps
│ └── system.nix # macOS preferences
│
└── 🧩 modules/ # User-level configurations
├── git.nix # Git settings & aliases
├── packages.nix # Development tools
├── theme.nix # Color themes (unused)
├── tmux.nix # Terminal multiplexer config
└── zsh.nix # Shell configuration
| Command | Description |
|---|---|
darwin-rebuild switch --flake .#sahrulramdan |
Apply configuration changes |
home-manager switch --flake . |
Update home environment only |
nix flake update |
Update all dependencies |
nix flake update <input> |
Update specific dependency |
nix-collect-garbage -d |
Clean up old generations |
🆕 Adding a Package
For CLI tools, edit modules/packages.nix:
home.packages = with pkgs; [
# ... existing packages
your-new-package
];For GUI applications, edit darwin/homebrew.nix:
casks = [
# ... existing casks
"your-gui-app"
];⚙️ Modifying System Settings
Edit darwin/system.nix to change macOS preferences:
system.defaults = {
dock.autohide = true; # Example setting
# Add your preferences here
};🐚 Adding Shell Aliases
Edit modules/zsh.nix:
shellAliases = {
# ... existing aliases
myalias = "your-command";
};Node.js Python Go Rust Ruby Java
Docker Kubernetes Terraform AWS CLI Google Cloud SDK
Visual Studio Code Zed Medis MongoDB Compass KeyCastr Opera
fzf ripgrep bat eza zoxide starship tmux neovim git htop
Ghostty JetBrains Mono Nerd Font Fira Code Hack Nerd Font
Feel free to fork this repository and customize it for your own needs! If you find any issues or have suggestions, please open an issue.
This configuration is available under the MIT License. See LICENSE for details.