diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-12-25 16:21:32 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-12-25 16:46:27 +0100 |
commit | 1cdec23e1a3a7f06a0a30cf036d7355ea601fc40 (patch) | |
tree | 8f0cfb696709e165c66f8a0b9efddf28bdc746e9 /notes/deploy.md | |
parent | build(scripts/mk_network_config): Init (diff) | |
download | nixos-server-1cdec23e1a3a7f06a0a30cf036d7355ea601fc40.tar.gz nixos-server-1cdec23e1a3a7f06a0a30cf036d7355ea601fc40.zip |
build(scripts/deploy): Init
This documents the commands used for the first deployment (i.e., with a full, disko-driven, disk formatting step).
Diffstat (limited to 'notes/deploy.md')
-rw-r--r-- | notes/deploy.md | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/notes/deploy.md b/notes/deploy.md index 2b274b5..8d159b1 100644 --- a/notes/deploy.md +++ b/notes/deploy.md @@ -1,8 +1,23 @@ -# Full redeployment +# Full redeployment or first deployment -After a complete server purge just load up the newest NixOS ISO, set the root password and run: +This requires a root password and _some_ Linux distribution running on it. + +We assume that following variables are set. + +```bash +HOST="<host-name>" # e.g., server1 +SSH_URL="<ssh-url>" # e.g., root@server1.vhack.eu +``` + +## Generate a networking configuration + +```bash +scp scripts/mk_network_config.sh "$SSH_URL:/root/" +ssh "$SSH_URL" /root/mk_networking_config.sh > "hosts/by-name/$HOST/networking.nix" +``` + +## Re-deploy ```bash -ipv4_address=$(dig +short "<hostname>"); # ipv6 seems to fail in this context -nix run github:numtide/nixos-anywhere -- --flake .#<hostname> root@"$ipv4_address" +./scripts/deploy.sh "$SSH_URL" "$HOST" ``` |