Add install script from iogamaster
This commit is contained in:
parent
9dc0377a77
commit
061f196afc
27
packages/install/default.nix
Normal file
27
packages/install/default.nix
Normal file
@ -0,0 +1,27 @@
|
||||
{ writeShellScriptBin, gum, ... }:
|
||||
# https://github.com/IogaMaster/dotfiles/blob/main/packages/install/default.nix
|
||||
writeShellScriptBin "install" ''
|
||||
${gum}/bin/gum style --border normal --margin "1" --padding "1 2" --border-foreground 212 "✨ IogaMaster's dotfiles installer ✨"
|
||||
echo "This script will wipe the remote system!"
|
||||
${gum}/bin/gum confirm "Cancel..." && exit
|
||||
|
||||
echo
|
||||
echo "🔥 kexec into the NixOS Installer..."
|
||||
ssh root@$2 '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'
|
||||
ssh root@$2 '/root/kexec/run'
|
||||
|
||||
echo
|
||||
echo "⏰ Waiting for host nixos to come online..."
|
||||
while true; do ping -c1 nixos > /dev/null && break; done
|
||||
|
||||
echo
|
||||
echo "📥 Grabbing hardware config..."
|
||||
ssh root@nixos 'nixos-generate-config --show-hardware-config --root /mnt' > systems/x86_64-linux/$1/hardware-configuration.nix
|
||||
|
||||
echo
|
||||
echo "✅ Installing..."
|
||||
nix run github:nix-community/nixos-anywhere -- --flake .#$1 root@nixos
|
||||
|
||||
echo
|
||||
echo "✨ Done!!!"
|
||||
''
|
Loading…
x
Reference in New Issue
Block a user