From 062ee013b1ee1177a0b801bf3f49e51fc1cfd357 Mon Sep 17 00:00:00 2001 From: hensoko <hensoko@gssws.de> Date: Mon, 17 Feb 2025 16:56:16 +0000 Subject: [PATCH 1/4] Update docs/nixos-anywhere.md Signed-off-by: hensoko <hensoko@gssws.de> --- docs/nixos-anywhere.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/nixos-anywhere.md b/docs/nixos-anywhere.md index a8f7925..e7d5681 100644 --- a/docs/nixos-anywhere.md +++ b/docs/nixos-anywhere.md @@ -1,7 +1,6 @@ -``` -curl -L https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz | tar -xzf- -C /root -/root/kexec/run -``` +# Deploying with nixos-anywhere + +## Basic steps ``` mkdir -p /etc/secrets/initrd @@ -9,5 +8,14 @@ ssh-keygen -t ed25519 -f /etc/secrets/initrd/ssh_host_ed25519_key ``` ``` -nix run github:nix-community/nixos-anywhere -- --flake .#blue-shell root@194.13.83.205 +nix run github:nix-community/nixos-anywhere -- --flake .#<host> root@<ip> +``` + +## Enter NixOS from non-NixOS host + +In case you cannot boot easily into a nixos-installer image you can download the kexec installer image of NixOS and kexec into it: + +``` +curl -L https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz | tar -xzf- -C /root +/root/kexec/run ``` -- 2.47.2 From 4946cc7000546a0a3ff85acebd048163d730deed Mon Sep 17 00:00:00 2001 From: hensoko <hensoko@noreply.git.pub.solar> Date: Mon, 17 Feb 2025 19:03:29 +0000 Subject: [PATCH 2/4] Update docs/nixos-anywhere.md --- docs/nixos-anywhere.md | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/nixos-anywhere.md b/docs/nixos-anywhere.md index e7d5681..8cabce9 100644 --- a/docs/nixos-anywhere.md +++ b/docs/nixos-anywhere.md @@ -1,17 +1,6 @@ # Deploying with nixos-anywhere -## Basic steps - -``` -mkdir -p /etc/secrets/initrd -ssh-keygen -t ed25519 -f /etc/secrets/initrd/ssh_host_ed25519_key -``` - -``` -nix run github:nix-community/nixos-anywhere -- --flake .#<host> root@<ip> -``` - -## Enter NixOS from non-NixOS host +## On Target: Enter NixOS from non-NixOS host In case you cannot boot easily into a nixos-installer image you can download the kexec installer image of NixOS and kexec into it: @@ -19,3 +8,17 @@ In case you cannot boot easily into a nixos-installer image you can download the curl -L https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz | tar -xzf- -C /root /root/kexec/run ``` + +## On Target: Create inital ssh host key used in initrd + +``` +mkdir -p /etc/secrets/initrd +ssh-keygen -t ed25519 -f /etc/secrets/initrd/ssh_host_ed25519_key +``` + +## Run NixOS Anywhere + +``` +nix run github:nix-community/nixos-anywhere -- --flake .#<host> root@<ip> +``` + -- 2.47.2 From 7b9150ed8b314f55008af4c696970ed9f68a1757 Mon Sep 17 00:00:00 2001 From: hensoko <hensoko@noreply.git.pub.solar> Date: Mon, 17 Feb 2025 19:17:32 +0000 Subject: [PATCH 3/4] Update docs/nixos-anywhere.md --- docs/nixos-anywhere.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/nixos-anywhere.md b/docs/nixos-anywhere.md index 8cabce9..b7f67e4 100644 --- a/docs/nixos-anywhere.md +++ b/docs/nixos-anywhere.md @@ -9,16 +9,22 @@ curl -L https://github.com/nix-community/nixos-images/releases/download/nixos-un /root/kexec/run ``` +## Run Disko + +``` +nix run github:nix-community/nixos-anywhere -- --flake .#<hostname> --target-host root@<host> --phases disko +``` + ## On Target: Create inital ssh host key used in initrd ``` -mkdir -p /etc/secrets/initrd -ssh-keygen -t ed25519 -f /etc/secrets/initrd/ssh_host_ed25519_key +mkdir -p /mnt/etc/secrets/initrd +ssh-keygen -t ed25519 -f /mnt/etc/secrets/initrd/ssh_host_ed25519_key ``` ## Run NixOS Anywhere ``` -nix run github:nix-community/nixos-anywhere -- --flake .#<host> root@<ip> +nix run github:nix-community/nixos-anywhere -- --flake .#<hostname> --target-host root@<host> --phases install,reboot ``` -- 2.47.2 From 1483d3f1cae3fe0983f5f0a1fee1cfeb07faf258 Mon Sep 17 00:00:00 2001 From: teutat3s <teutates@mailbox.org> Date: Mon, 17 Feb 2025 21:59:42 +0100 Subject: [PATCH 4/4] style: fix trailing whitespace --- docs/nixos-anywhere.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/nixos-anywhere.md b/docs/nixos-anywhere.md index b7f67e4..d7becc1 100644 --- a/docs/nixos-anywhere.md +++ b/docs/nixos-anywhere.md @@ -2,7 +2,7 @@ ## On Target: Enter NixOS from non-NixOS host -In case you cannot boot easily into a nixos-installer image you can download the kexec installer image of NixOS and kexec into it: +In case you cannot boot easily into a nixos-installer image you can download the kexec installer image of NixOS and kexec into it: ``` curl -L https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz | tar -xzf- -C /root @@ -27,4 +27,3 @@ ssh-keygen -t ed25519 -f /mnt/etc/secrets/initrd/ssh_host_ed25519_key ``` nix run github:nix-community/nixos-anywhere -- --flake .#<hostname> --target-host root@<host> --phases install,reboot ``` - -- 2.47.2