From d57601e4cb7e3f92cd306ae26acfc9486ff4f290 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Mon, 19 Dec 2022 15:10:26 +0100
Subject: [PATCH] drop kexec profile

---
 README.md       | 22 +++++++++++++++++-----
 roles/kexec.nix | 28 ----------------------------
 2 files changed, 17 insertions(+), 33 deletions(-)
 delete mode 100644 roles/kexec.nix

diff --git a/README.md b/README.md
index 87f064d..42984c5 100644
--- a/README.md
+++ b/README.md
@@ -121,21 +121,33 @@ $ inv deploy --hosts build02 reboot --hosts build02
 ```
 
 ## Install/Fix system from Hetzner recovery mode
-1. Install kexec image from Hetzner recovery system as described in [kexec.nix](roles/kexec.nix) and boot into it
 
-2. Format and/or mount all filesystems to /mnt:
+1. Copy your ssh key to the recovery system so that the kexec image can re-use it.
+
+``` console
+yourmachine> ssh-copy-id build0X.nix-community.org
+```
+
+2. Download and boot into kexec-image:
+
+``` console
+$ curl -L https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-kexec-installer-x86_64-linux.tar.gz | tar -xzf- -C /root
+$ /root/kexec/run
+```
+
+3. Format and/or mount all filesystems to /mnt:
 
 ```console
 $ inv format-disks --hosts buildXX --disks /dev/nvme0n1,/dev/nvme1n1
 ```
 
-3. Setup secrets
+4. Setup secrets
 
 ```console
 $ inv setup-secret --hosts buildXX
 ```
 
-4. Generate configuration and download to the repo
+5. Generate configuration and download to the repo
 
 ```console
 $ nixos-generate-config  --root /tmp
@@ -143,7 +155,7 @@ $ nixos-generate-config  --root /tmp
 $ scp buildXX.nix-community.org:/tmp/etc/nixos/hardware-configuration.nix buildXX/hardware-configuration.nix
 ```
 
-5. Build and install
+6. Build and install
 
 ```console
 $ inv install-nixos --hosts buildXX
diff --git a/roles/kexec.nix b/roles/kexec.nix
deleted file mode 100644
index 8b75c90..0000000
--- a/roles/kexec.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ config, lib, pkgs, ... }:
-# build with:
-# nix-shell -p nixos-generators --run 'nixos-generate -o ./result  -f kexec-bundle -c ./roles/kexec.nix'
-{
-  imports = [
-    ./users.nix
-    ./sshd.nix
-  ];
-
-  # ttyAMA0 is consoles on aarch64
-  boot.kernelParams = [ "console=ttyS0,115200n8" "console=ttyAMA0,115200n8" "console=tty0" ];
-}
-
-# Hetzner bootstrap from rescue system
-#
-#useradd -m -s /bin/bash foo
-#install -d -m700 -o foo /nix
-#su - foo
-#curl -L https://nixos.org/nix/install | bash
-#. /home/foo/.nix-profile/etc/profile.d/nix.sh
-#git clone https://github.com/nix-community/infra && cd infra
-#nix-shell
-#nix-shell -p nixos-generators --run 'nixos-generate -o ./result  -f kexec-bundle -c ./roles/kexec.nix'
-#exit
-#exit
-#/home/foo/infra/result
-#after reboot:
-#$  systemctl stop autoreboot.timer