NixOS Infect

  1. Copy SSH key to root user
sudo mkdir /root/.ssh
sudo cp ~/.ssh/authorized_keys /root/.ssh
  1. Update CA-Certificates (due to Let's Encrypt CA)

  2. Download and run the infect script

curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | bash -x
  1. Get environment with git
nix-shell -p git
  1. Get repo

  2. Install home-manager

nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update
  1. Copy repo to /etc/nixos

  2. Install system

nixos-rebuild switch
  1. Cleanup system
nix-collect-garbage -d