1.1 KiB
1.1 KiB
Gasdev infrastructure
Initial installation
Cloud providers not always provide a NixOS install option, so I use nixos-anywhere for remote NixOS installation using SSH
Kexec installation
As specified in nixos-images:
# Run as root
curl -L https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz | tar -xzf- -C /root
/root/kexec/run
The machine will restart in a new NixOS installation. The existing SSH keys are copied to the new installation's root user.
NixOS-everywhere
nix run github:nix-community/nixos-anywhere -- --flake .#<configuration name> root@<ip address>
Deploy configuration
In order to deploy new configuration changes after the initial NixOS installation, I use deploy-rs. It requires a properly set-up ssh-agent and SSH keys being installed on the root user.
Then you can deploy the new configuration:
deploy .#<configuration name>