nix-darwin
Nix modules for darwin, /etc/nixos/configuration.nix for macOS.
Install
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
./result/bin/darwin-installer
or if you run into problems with that, try the older bootstrap.sh script
NOTE: the system activation scripts don't overwrite existing etc files, so files like
/etc/bashrcand/etc/zshrcwon't be
updated by default. If you didn't use the installer or skipped some of the options you'll have to take care of this yourself.
Either modify the existing file to source/import the one from/etc/staticor remove it. Some examples:
mv /etc/bashrc /etc/bashrc.orig- `echo 'if test -e /etc/static/bashrc; then . /etc/static/bashrc; fi'