Introduction

Warning

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


nix-config - My Nix Configuration

This is not actively used for all my machines. I've moved back to Chezmoi as a dotfile manager.

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
titanx86_64-linuxIntel NUC for running NixOS bare metal
macvm (not active)aarch64-darwinNix-Darwin VM running in Parallels on MacBook
nixvm (not active)aarch64-linuxNixOS VM running in Parallels on MacBook
odin (not active)aarch64-darwinMain MacBook Pro laptop
ragnar (not active)x86_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)

I have MacOS aliases dupb (darwin update build) to do a build only and show what changes. dup (darwin update) does the build and an install.

Bootstrapping NixOS Machines

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