Skip to content

Latest commit

 

History

160 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nix config

Setup

Nix

Darwin

Pre

softwareupdate --install-rosetta --agree-to-license
xcode-select --install

Install Nix (flakes aren't enabled by default, hence --extra-experimental-features below):

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

Must match a darwinConfigurations entry in flake.nix (currently 9089, 9099) — add a new one for a new machine:

sudo scutil --set HostName <hostname>
cd
git clone https://github.com/philingood/nix-config.git
git clone https://github.com/philingood/dotfiles.git

Note

Easy to forget, not managed by nix:

  • SSH key added to your GitHub account (needed to git push, both repos above are cloned over https so this isn't a hard blocker yet)
  • GPG key imported (gpg-suite gets installed, but the key itself isn't)
  • Nextcloud client logged in and synced to ~/nc (see Local config below — screenshot location depends on it)
  • create ~/.config/nix-config-local.nix, see Local config below

Build

cd ~/nix-config

darwin-rebuild isn't installed/in PATH yet on a fresh machine — building first and invoking it straight out of ./result sidesteps that, so this works for both first install and every switch after:

nix --extra-experimental-features "nix-command flakes" build .#darwinConfigurations.$(hostname -s).system
./result/sw/bin/darwin-rebuild switch --flake .#$(hostname -s) --impure

Post

sudo xcodebuild -license accept
nix-index

Local config (per-machine, not in git)

Private per-machine values (currently just screenshot location) live in ~/.config/nix-config-local.nix, read by modules/darwin/preferences.nix. Not part of the repo, so it has to be recreated on each machine:

{
  screenshotLocation = "~/nc/Photos/Screenshots/";
}

Requires --impure (baked into the dwsw alias, but needed manually on first switch, see above).

dotfiles

Karabiner and Ghostty configs are not managed by this repo — they're frequently live-edited (Karabiner via its own GUI), so they're stowed from dotfiles instead (cloned in Pre above):

cd ~/dotfiles
./setup.sh

About

Nix Home-Manager configuration

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages