Skip to content

dominiq-eu/nix-darwin-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

README.md

This repository provides a template for managing homebrew apps and terminal programs for macOS using Nix, flakes, and nix-darwin.

The goal is a reproducible, shareable macOS setup that can be installed and updated reliably across multiple machines.

The template includes:

  • A full nix-darwin system configuration
  • Package definitions
  • macOS defaults
  • Helper scripts for installation and updates

1. Requirements

You need:

  • macOS (Intel or Apple Silicon)
  • Xcode Command Line Tools

Install the Xcode Command Line Tools if missing:

xcode-select --install

2. Copy the template into the correct locations

This project is not used directly from the repo. Its contents must be copied into the correct directories inside your home folder.

Copy the directories from this template as follows:

./dot_config/nix     →   ~/.config/nix/
./dot_local/bin      →   ~/.local/bin/

Example:

mkdir -p ~/.config/nix
mkdir -p ~/.local/bin

cp -r dot_config/nix/* ~/.config/nix/
cp -r dot_local/bin/* ~/.local/bin/

3. Add ~/.local/bin to your PATH

If ~/.local/bin is not already in your PATH, add it manually.

For zsh:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Check:

which dot-init.sh

If it prints a path → you're good.

4. Initial Installation (Nix + nix-darwin)

Run the installation script:

dot-init.sh

This script:

  • Installs Nix (multi-user mode)
  • Installs nix-darwin using flakes
  • Applies your macOS configuration
  • Loads all system defaults and settings from this template

After successful installation, you can manually trigger a rebuild anytime:

darwin-rebuild switch --flake ~/.config/nix

5. Updating the System Configuration

Whenever you update any Nix configuration files inside:

~/.config/nix/

apply the changes with:

dot-update.sh

6. Project Structure

  • flake.nix: Main flake definition for nix-darwin.
  • macos.nix: All macOS defaults, UI tweaks, system settings, etc.
  • packages.nix: Global packages installed system-wide.
  • utils.nix: Utility helpers used throughout the configuration.
  • nix.conf: User-level Nix configuration.
  • dot-init.sh: Bootstraps Nix + nix-darwin on a fresh machine.
  • dot-update.sh: Applies configuration changes to the running system.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors