Skip to content

About

Fork to get NixOps4 Production Ready.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

43 Commits

Folders and files

Repository files navigation

nixops4-nixos

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.

Test Drive

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 -A

Generate SSH key:

ssh-keygen -t ed25519 -f deployer-key -N "" -C "deployer"
cp deployer-key.pub deployer.pub
git add deployer.pub

Start 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 default

Verify:

ssh -i deployer-key -p 2222 root@127.0.0.1 'cat /etc/greeting'
# Output: Hallo wereld

Cleanup: stop the VM (Ctrl+C in VM terminal), then:

rm nixos.qcow2
ssh-keygen -R '[127.0.0.1]:2222'

About

Fork to get NixOps4 Production Ready.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages