Skip to content

nixops4/nixops4-nixos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 [email protected] '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

An integration to deploy NixOS with NixOps4

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors