Skip to content

nyxsr/nix-darwin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍏 Sahrul's macOS Development Environment

Nix macOS License

A declarative, reproducible, and modular macOS configuration using Nix Darwin, Home Manager, and Homebrew.

FeaturesQuick StartStructureUsage


✨ Features

🎯 Declarative Configuration

  • System settings as code
  • Version controlled environment
  • Reproducible across machines

📦 Smart Package Management

  • Nix for development tools
  • Homebrew for GUI apps
  • Automatic updates

🛠️ Developer Ready

  • Multiple language toolchains
  • Modern CLI utilities
  • Cloud & container tools

🎨 Customized Experience

  • Optimized macOS settings
  • ZSH with Oh My Zsh
  • Developer fonts (JetBrains Mono, Fira Code)

🚀 Quick Start

Prerequisites

  • macOS (Apple Silicon or Intel)
  • Nix with flakes enabled
  • Git for cloning this repository

Installation

# 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

📁 Structure

~/.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

🔧 Usage

Common Commands

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

Making Changes

🆕 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";
};

🌟 Included Tools

Development Languages

Node.js Python Go Rust Ruby Java

DevOps & Cloud

Docker Kubernetes Terraform AWS CLI Google Cloud SDK

Productivity Apps

Visual Studio Code Zed Medis MongoDB Compass KeyCastr Opera

CLI Utilities

fzf ripgrep bat eza zoxide starship tmux neovim git htop

Terminal & Fonts

Ghostty JetBrains Mono Nerd Font Fira Code Hack Nerd Font

🤝 Contributing

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.

📝 License

This configuration is available under the MIT License. See LICENSE for details.


Built with ❤️ using Nix

About

My nix darwin configurations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages