mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
project-wide: nyx removed, README update
This commit is contained in:
parent
2b258b083f
commit
6fb326015e
2 changed files with 2 additions and 54 deletions
10
README.md
10
README.md
|
|
@ -1,10 +1,4 @@
|
|||
# kat's nixfiles
|
||||
|
||||
To provision a new host:
|
||||
|
||||
* create a config for that host that contains a deploy.ssh.host
|
||||
* run `./nyx install <hostname>`.
|
||||
|
||||
To rebuild a host:
|
||||
|
||||
* run `./nyx deploy <hostname> <method>` where method is optional, can be... switch or boot or such.
|
||||
* `nix run -f . deploy.target.<target name>.run.apply`
|
||||
* `nix run -f . deploy.target.<target name>.run -c terraform destroy`
|
||||
|
|
|
|||
46
nyx
46
nyx
|
|
@ -1,46 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
usage() {
|
||||
echo example: $0 build samhain boot
|
||||
}
|
||||
|
||||
eval_setup() {
|
||||
HOST=$1
|
||||
if [ $# -gt 2 ]; then
|
||||
METHOD=$2
|
||||
else
|
||||
METHOD="switch"
|
||||
fi
|
||||
}
|
||||
|
||||
cmd_deploy() {
|
||||
eval_setup $@
|
||||
bash <(nix eval --raw deploy.${HOST} -f .) ${METHOD}
|
||||
}
|
||||
|
||||
cmd_debug() {
|
||||
eval_setup $@
|
||||
nix eval --raw deploy.$HOST -f .
|
||||
}
|
||||
|
||||
cmd_install() {
|
||||
HOST=$1
|
||||
nix build -f . hosts.$HOST.config.system.build.toplevel
|
||||
CLOSURE=$(readlink result)
|
||||
nix-store --export $(nix-store -qR ./result) | ssh root@$HOST nix-store --import --store /mnt
|
||||
ssh root@$HOST nixos-install --system $CLOSURE
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ $# -lt 2 ]; then
|
||||
usage
|
||||
else
|
||||
CMD=$1
|
||||
shift
|
||||
|
||||
cmd_$CMD $@
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue