archiving this config and forking https://github.com/ryan4yin/nix-config instead
Note
This fork isn't really meant for public consumption (yet).
Check out the original from dustinlyons instead.
- Homebrew taps, can we define in just one place instead of two?
- Clean up and remove parts from original fork we aren't using
- enable x86-64 Nix packages
xcode-select --install
Installer from Determinate Systems
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
After installation, open a new terminal session to make the nix
executable available in your $PATH
.
mkdir -p ~/.config && cd ~/.config
git clone https://github.com/b4lisong/nix-config.git
4. Make apps executable
find apps/$(uname -m | sed 's/arm64/aarch64/')-darwin -type f \( -name apply -o -name build -o -name build-switch -o -name create-keys -o -name copy-keys -o -name check-keys \) -exec chmod +x {} \;
Before generating your first build, these keys must exist in your ~/.ssh
directory.
Key Name | Platform | Description |
---|---|---|
id_ed25519 | macOS / NixOS | Download secrets from Github. Used only during bootstrap. |
id_ed25519_agenix | macOS / NixOS | Copied over, used to encrypt and decrypt secrets. |
nix run .#check-keys
Ensure the build works before deploying the configuration, run:
nix run .#build
Note
If you're using a git repository, only files in the working tree will be copied to the Nix Store.
You must run git add .
first.
Warning
You may encounter error: Unexpected files in /etc, aborting activation
if nix-darwin
detects it will overwrite
an existing /etc/
file. The error will list the files like this:
The following files have unrecognized content and would be overwritten:
/etc/nix/nix.conf
/etc/bashrc
Please check there is nothing critical in these files, rename them by adding .before-nix-darwin to the end, and then try again.
Backup and move the files out of the way and/or edit your Nix configuration before continuing.
Finally, alter your system with this command:
nix run .#build-switch
Note
If you needed to rename /etc/nix/nix.conf
to /etc/nix/nix.conf.before-nix-darwin
, the first build command needs to be:
nix --extra-experimental-features 'nix-command flakes' run .#build-switch