Skip to content

Latest commit

 

History

History
55 lines (45 loc) · 1.71 KB

bootstrap.org

File metadata and controls

55 lines (45 loc) · 1.71 KB

Bootstrap new macOS system with Nix

After the system installation and copying of the ~/src directory, first thing is to make sudo easier to use, if desired:

EDITOR=vi sudo visudo

Install Nix:

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

Logout and back in, then install the minimum needed tools, which is git and make:

nix-env -i git gnumake

Setup the shell environment, since a few things are missing:

export HOSTNAME=hermes
export NIX_CONF=/Users/johnw/src/nix
export NIX_PATH=/Users/johnw/.nix-defexpr/channels:darwin=/Users/johnw/src/nix/darwin:darwin-config=/Users/johnw/src/nix/config/darwin.nix:hm-config=/Users/johnw/src/nix/config/home.nix:home-manager=/Users/johnw/src/nix/home-manager:localconfig=/Users/johnw/src/nix/config/${HOSTNAME}.nix:nixpkgs=/Users/johnw/src/nix/nixpkgs:ssh-auth-sock=/Users/johnw/.config/gnupg/S.gpg-agent.ssh:ssh-config-file=/Users/johnw/.ssh/config

Build the Nix environment. This will take a very long time:

~/src/nix/bin/u hermes build

In order to switch to the new environment, we need darwin-rebuild to be on the path:

export DARWIN_REBUILD=$(find /nix/store -name darwin-rebuild -type f | head -1)
export PATH=${DARWIN_REBUILD}/..:$PATH

Remove what we installed manually above. Note that these may also need to be manually added to the path, as we did for darwin-rebuild.

nix-env -e git gnumake

Now we can switch:

~/src/nix/bin/u hermes switch