diff --git a/.gitignore b/.gitignore index 8b68560..e0f5047 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .direnv .VSCodeCounter +anywhere result* *.bak *.qcow2 diff --git a/scripts/anywhere.sh.example b/scripts/anywhere.sh.example new file mode 100644 index 0000000..00aa6b0 --- /dev/null +++ b/scripts/anywhere.sh.example @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Create a temporary directory +temp=$(mktemp -d) + +# Function to cleanup temporary directory on exit +cleanup() { + rm -rf "$temp" +} +trap cleanup EXIT + +# Create the directory where sshd expects to find the host keys +install -d -m755 "$temp/etc/ssh" + +# Decrypt your private key from the password store and copy it to the temporary directory +pass ssh_host_rsa_key > "$temp/etc/ssh/ssh_host_rsa_key" + +# Set the correct permissions so sshd will accept the key +chmod 600 "$temp/etc/ssh/ssh_host_rsa_key" + +# Install NixOS to the host system with our secrets +nixos-anywhere --extra-files "$temp" --flake '.#your-host' root@yourip \ No newline at end of file diff --git a/size.sh b/size.sh new file mode 100755 index 0000000..fe8a25d --- /dev/null +++ b/size.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +nix-store -q --size $(nix-store -qR $(readlink -e $1) ) | \ +awk '{ a+=$1 } END { print a }' | \ +numfmt --to=iec-i