Introduction

Warning

These docs contain information that relates to my setup. They may or may not work for you.


nix-config - My Nix Configuration

See the full documentation at szinn.github.io/nix-config.

I manage my personal machines using Nix and Home-Manager.

The machines consist of:

MachineSystemPurpose
herax86_64-linuxIntel NUC for running NixOS bare metal
macvmaarch64-darwinNix-Darwin VM running in Parallels on MacBook
nixvmaarch64-linuxNixOS VM running in Parallels on MacBook
odinaarch64-darwinMain MacBook Pro laptop
ragnarx86_64-linuxNAS server

Bootstrapping MacOS Machines

Darwin machines can be bootstrapped from the nix-config repository directly.

bash -c "$(curl -LsS https://raw.githubusercontent.com/szinn/nix-config/main/bootstrap.sh)"

At this point, NIX should be installed. Restart the shell.

To bootstrap the configuration now, run

nix run --extra-experimental-features nix-command --extra-experimental-features flakes nix-darwin -- switch --flake .#$(hostname -s)

There might be a few files in /etc that need renaming to complete the installation.

sudo mv /etc/nix/nix.conf /etc/nix.conf.before-nix-darwin
sudo mv /etc/shells /etc/shells.before-nix-darwin
sudo mv /etc/zshenv /etc/zshenv.before-nix-darwin

Afterwards, if the configuration is touched, darwin-rebuild is required to run the updates.

git add . ; darwin-rebuild switch --flake .#$(hostname -s)

If just the home tree is touched, then home-manager is sufficient to run the updates.

git add . ; home-manager switch --flake.#$(whoami)@(hostname -s)

Bootstrapping NixOS Machines

The process for bootstrapping a NixOS machine is essentially following the VM process