Skip to content

Repository files navigation

System Config

Manage macOS using Nix, nix-darwin and Home Manager.

Prerequisites

Set hostname to a known (configured) value:

  • m4-mbp (macOS)
  • macos-virtual (macOS)
  • drummer (NixOS)
  • xcel (Debian, Home Manager)
  • pi-01 (Debian/Pi, Home Manager)

Install Nix:

sh <(curl -L https://nixos.org/nix/install) --daemon

Install command line tools for git (brute force):

xcode-select --install

Give Terminal.app "Full Disk Access" in System Preferences > Privacy & Security > Privacy > Full Disk Access. This is required for some of the nix-darwin system settings to apply successfully. I've disabled this for now.

Install Homebrew:

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

Clone system-config

mkdir -p ~/dev/src
cd ~/dev/src
git clone https://github.com/johnallen3d/system-config.git
cd system-config

Secrets

Secrets are managed in the Doppler system-config project. After authenticating the Doppler CLI, initialize this repository using its checked-in defaults:

doppler login
doppler setup

Run commands that need secrets with doppler run -- <command>.

Install nix-darwin and initial apply:

nix \
  --extra-experimental-features "flakes nix-command" \
  run nix-darwin \
  -- switch --flake ~/dev/src/system-config

Apply Changes

# on macOS (run from this repository)
mise update-system
# skip flake input update
mise update-system --switch-only
# also refresh nix-managed Pi packages
mise update-system --switch-only --pi-refresh
# refresh Pi packages without rebuilding
mise update-system --pi-only

# on NixOS
sudo nixos-rebuild switch --impure --flake ~/dev/src/system-config/.#

# on Debian/Pi (using home-manager)
home-manager switch -b backup --flake ~/dev/src/system-config/.#john.allen@pi-01

# on Debian/Orb (using home-manager)
home-manager switch -b backup --flake ~/dev/src/system-config/.#john.allen@xcel --impure

Update Installed Packages

nix flake update --commit-lock-file
# or from another directory
pushd ~/dev/src/system-config; nix flake update --commit-lock-file; nixswitch; popd

About

My system configuration using nix/nix-darwin/home-manager

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages