mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
nix-env -iA nixos.git
git clone https://github.com/ddervisis/dotnix ~/dotnix
cd ~/dotnix
nix build .#darwinConfigurations.<host>.system
./result/sw/bin/darwin-rebuild switch --flake .#<host>
darwin-rebuild switch --flake .#<host>
nixos-generate-config --root /mnt
Clone Nix config files repo
nix-env -iA nixos.git
git clone https://github.com/ddervisis/dotnix /mnt/etc/nixos/dotnix
Switch hardware-configuration
cp /mnt/etc/nixos/dotnix/hosts/<host>/hardware-configuration.nix /mnt/etc/nixos/
cd /mnt/etc/nixos/dotnix
nixos-install --flake .#<host>
# login as root in tty1
passwd $USER
# login as $USER
mkdir -p ~/.ssh
curl https://github.com/${USER}.keys | tee -a ~/.ssh/authorized_keys