This repository provides a NixOps4 integration for deploying NixOS configurations to existing NixOS hosts.
Warning
This is pre-release software. Features and functionality are subject to change.
Note
This is not representative of the final product, which should include convenience options for defining hosts without manually specifying resource definitions.
Try deploying to a local QEMU VM:
Initialize from template:
mkdir my-deployment && cd my-deployment
nix flake init -t github:nixops4/nixops4-nixos
git init && git add -AGenerate SSH key:
ssh-keygen -t ed25519 -f deployer-key -N "" -C "deployer"
cp deployer-key.pub deployer.pub
git add deployer.pubStart the VM (in a separate terminal):
nix run '.#vm'Get the VM's host key, add it to known_hosts, and update deployment.nix:
ssh-keyscan -t ed25519 -p 2222 127.0.0.1 | tee -a ~/.ssh/known_hosts
# Copy the ssh-ed25519 key to deployment.nix: ssh.hostPublicKey = "..."Deploy:
nix develop --command nixops4 apply defaultVerify:
ssh -i deployer-key -p 2222 [email protected] 'cat /etc/greeting'
# Output: Hallo wereldCleanup: stop the VM (Ctrl+C in VM terminal), then:
rm nixos.qcow2
ssh-keygen -R '[127.0.0.1]:2222'