Skip to content
/ dotfiles Public template

My declarative dotfiles managed with Nix, nix-darwin and home-manager, focusing on Darwin (i.e. macOS systems).

Notifications You must be signed in to change notification settings

ryanmalonzo/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

❄️ Nix Dotfiles (Darwin)

A declarative macOS system configuration using Nix Darwin and Home Manager.

Features

  • System Configuration: macOS system settings, security, and defaults
  • Application Management: Homebrew integration for GUI applications
  • Development Environment: Shell configuration, development tools, and programming languages
  • Dotfiles Management: Centralized configuration for CLI tools and applications
  • Multi-Host Support: Separate configurations for personal and work machines

Prerequisites

  1. Install macOS dependencies
xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Install Determinate Nix using the Determinate Nix Installer
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
sh -s -- install

Important

When prompted, choose to install Determinate Nix, not the regular Nix.

Then start a new shell session for nix to become available in $PATH.

Usage

  1. Clone this repository
git clone https://github.com/ryanmalonzo/dotfiles ~/dotfiles && \
cd ~/dotfiles
  1. Apply the configuration

For the first time setup:

sudo nix run nix-darwin -- switch --flake .

Or specify a specific profile with:

sudo nix run nix-darwin -- switch --flake .#<profile_name>

Note

After the initial setup, subsequent configuration updates must be run with sudo privileges.

For subsequent updates:

# Update and apply configuration (requires sudo)
sudo darwin-rebuild switch --flake .#<profile_name>

Common tasks

# Delete old generations
nix-collect-garbage -d

# Update all flake inputs
nix flake update

# Update specific input
nix flake lock --update-input nixpkgs
nix flake lock --update-input home-manager

Troubleshooting

Permission Issues

If you encounter permission errors during cleanup operations (like uninstalling applications), you may need to:

  1. Enable Full Disk Access for your terminal application
  2. Go to System SettingsPrivacy & SecurityFull Disk Access
  3. Add your terminal application (Terminal.app, iTerm2, etc.)

Environment Variables

After applying configuration changes, you may need to:

  • Restart your terminal application, or
  • Run source ~/.zshrc to reload environment variables

Some changes (like npm configuration) may require a new shell session to take effect.

Acknowledgements

About

My declarative dotfiles managed with Nix, nix-darwin and home-manager, focusing on Darwin (i.e. macOS systems).

Topics

Resources

Stars

Watchers

Forks

Languages