Add bootstrap script
Adds a very simple bootstrap script for setting up a new host. I'm not exactly sure the best way to use this yet. Though I suppose it could be run with some sort of "curl https://blahblah | bash" shenanigans. That just seems like it would be about as much effort as just running the nixos-rebuild command itself from a new host. In any case though, this worked well for bootstrapping a new wixos instance. So that was nice.
This commit is contained in:
11
bootstrap.sh
Executable file
11
bootstrap.sh
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# bootstrap.sh
|
||||||
|
# Usage: sudo ./bootstrap.sh <hostname>
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
NEW_HOSTNAME="${1:?missing hostname}"
|
||||||
|
FLAKE_URI="git+https://git.johnogle.info/johno/nixos-configs.git#${NEW_HOSTNAME}"
|
||||||
|
|
||||||
|
export NIX_CONFIG="experimental-features = nix-command flakes"
|
||||||
|
nixos-rebuild switch --flake "$FLAKE_URI"
|
||||||
|
|
||||||
Reference in New Issue
Block a user