update install process
This commit is contained in:
parent
11e0e6930b
commit
1c58d0b2d7
2 changed files with 45 additions and 1 deletions
3
init.sh
3
init.sh
|
@ -33,9 +33,10 @@ echo " 4. finish setup for tudbut user"
|
||||||
echo " 5. login on tty7"
|
echo " 5. login on tty7"
|
||||||
echo " 6. go back to tty1 and do what nixos-edit tells you"
|
echo " 6. go back to tty1 and do what nixos-edit tells you"
|
||||||
echo
|
echo
|
||||||
echo -n "do you want to reboot now? [Y/n] "
|
echo -n "do you want to install and reboot now? [Y/n] "
|
||||||
read yn
|
read yn
|
||||||
if [ "$yn" != n ] ; then
|
if [ "$yn" != n ] ; then
|
||||||
|
nixos-install || exit 1
|
||||||
echo "rebooting"
|
echo "rebooting"
|
||||||
sleep 1
|
sleep 1
|
||||||
reboot
|
reboot
|
||||||
|
|
43
install.sh
Normal file
43
install.sh
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "this is meant to be run from the iso!!!"
|
||||||
|
if [ $(whoami) = nixos ] ; then
|
||||||
|
echo "iso detected. continue!"
|
||||||
|
else
|
||||||
|
echo "you don't appear to be in the install iso."
|
||||||
|
echo -n "are you SURE??? (y/N) "
|
||||||
|
read sure
|
||||||
|
if ! [ "$sure" = "y" ] ; then
|
||||||
|
echo "ok. exiting."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "i will continue."
|
||||||
|
fi
|
||||||
|
|
||||||
|
lsblk
|
||||||
|
echo -n "> what drive to install on? /dev/"
|
||||||
|
read drive
|
||||||
|
fdisk "/dev/$drive" << "EOF"
|
||||||
|
o
|
||||||
|
n
|
||||||
|
p
|
||||||
|
1
|
||||||
|
|
||||||
|
|
||||||
|
a
|
||||||
|
w
|
||||||
|
EOF > /dev/null || exit 1
|
||||||
|
echo "> created DOS partition table on $disk with one bootable partition."
|
||||||
|
mkfs.ext4 $disk*1 || exit 1 # /dev/sda 1 or /dev/nvme0n1 p1 => *1 instead of just 1
|
||||||
|
echo "> formatted."
|
||||||
|
mount $disk*1 /mnt || exit 1
|
||||||
|
echo "> mounted."
|
||||||
|
cd /mnt/etc/nixos
|
||||||
|
echo "> installing git"
|
||||||
|
nix-env -i git > /dev/null || exit 1
|
||||||
|
echo "> downloading tudbut/nix-setup"
|
||||||
|
git clone https://git.tudbut.de/tudbut/nix-setup
|
||||||
|
rm configuration.nix
|
||||||
|
pushd ; mv $(ls -a) .. ; popd
|
||||||
|
echo "> initializing"
|
||||||
|
bash init.sh
|
Loading…
Add table
Reference in a new issue