Files
vps-nixos/scripts/install.sh
T
aloslider c11e41669b Init
Initial commit, nodes are mostly done, panel is WIP
2026-11-16 01:01:01 +03:00

26 lines
560 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
root=$(cd "$(dirname "$0")/.." && pwd)
cd "$root"
source "$root/scripts/select-node.sh"
if [[ $# -ge 1 ]]; then
host=$1
else
host=$(select_node)
fi
age_key="${VPS_AGE_KEY:-$HOME/.config/sops/age/$host-key.txt}"
extra_dir=$(mktemp -d)
trap 'rm -rf "$extra_dir"' EXIT
install -d -m 0700 "$extra_dir/etc/age"
install -m 0600 "$age_key" "$extra_dir/etc/age/key.txt"
nix run github:nix-community/nixos-anywhere -- \
--no-disko-deps \
--flake ".#$host" \
--target-host "root@$host" \
--extra-files "$extra_dir"