forked from hswaw/hscloud
Serge Bazanski
b3c6770f8d
This moves the diff-and-activate logic from cluster/nix/provision.nix into ops/{provision,machines}.nix that can be used for both cluster machines and bgpwtf machines. The provisioning scripts now live per-NixOS-config, and anything under ops.machines.$fqdn now has a .passthru.hscloud.provision derivation which is that script. When ran, it will attempt to deploy onto the target machine. There's also a top-level tool at `ops.provision` which builds all configurations / machines and can be called with the machine name/fqdn to call the corresponding provisioner script. clustercfg is changed to use the new provisioning logic. Change-Id: I258abce9e8e3db42af35af102f32ab7963046353
654 B
654 B
Operations
Deploying NixOS machines
Machine configurations are in ops/machines.nix
.
Wrapper script to show all available machines and provision a single machine:
$ $(nix-build -A ops.provision)
Available machines:
- bc01n01.hswaw.net
- bc01n02.hswaw.net
- dcr01s22.hswaw.net
- dcr01s24.hswaw.net
- edge01.waw.bgp.wtf
$ $(nix-build -A ops.provision) edge01.waw.bgp.wtf
This can be slow, as it evaluates/builds all machines' configs. If you just want to deploy one machine and possible iterate faster:
$ $(nix-build -A 'ops.machines."edge01.waw.bgp.wtf".config.passthru.hscloud.provision')