From 6fb326015ebc20b9a4a5130ab2a71006f128c4c8 Mon Sep 17 00:00:00 2001 From: kat witch Date: Sun, 4 Apr 2021 23:00:19 +0100 Subject: [PATCH] project-wide: nyx removed, README update --- README.md | 10 ++-------- nyx | 46 ---------------------------------------------- 2 files changed, 2 insertions(+), 54 deletions(-) delete mode 100755 nyx diff --git a/README.md b/README.md index 1ebd7572..d9f4d281 100644 --- a/README.md +++ b/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 `. - -To rebuild a host: - -* run `./nyx deploy ` where method is optional, can be... switch or boot or such. +* `nix run -f . deploy.target..run.apply` +* `nix run -f . deploy.target..run -c terraform destroy` diff --git a/nyx b/nyx deleted file mode 100755 index aa69ec21..00000000 --- a/nyx +++ /dev/null @@ -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 "$@"