Skip to content

My macOS setup with nix and Homebrew, managed by nix-darwin

Notifications You must be signed in to change notification settings

dxmh/system-config

Repository files navigation

My system configuration

My macOS setup with nix and Homebrew, managed by nix-darwin.

Initial setup

On a fresh Mac, some setup is required before we can use nix-darwin:

Nix

Install nix itself, as per the nix installation docs:

curl -L https://nixos.org/nix/install | sh

Homebrew

Install brew (so we can manage GUI applications with nix-darwin), as per the brew.sh instructions:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Rosetta 2

Install Rosetta if necessary:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

nix-darwin

Create the /run symlink that the nix-darwin installer would usually set up:

printf 'run\tprivate/var/run\n' | sudo tee -a /etc/synthetic.conf
/System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util -t

Build our flake:

nix --experimental-features "nix-command flakes" \
	build github:dxmh/system-config#darwinConfigurations.setze.system

Now we can run nix-darwin for the first time:

./result/sw/bin/darwin-rebuild switch \
	--flake github:dxmh/system-config#setze

About

My macOS setup with nix and Homebrew, managed by nix-darwin

Topics

Resources

Stars

Watchers

Forks