install.sh: fixes
This commit is contained in:
parent
4711fae914
commit
ba88fc7a29
1 changed files with 7 additions and 6 deletions
13
install.sh
13
install.sh
|
@ -17,7 +17,7 @@ fi
|
||||||
lsblk
|
lsblk
|
||||||
echo -n "> what drive to install on? /dev/"
|
echo -n "> what drive to install on? /dev/"
|
||||||
read drive
|
read drive
|
||||||
sudo fdisk "/dev/$drive" << "EOF"
|
sudo fdisk "/dev/$drive" << EOF
|
||||||
o
|
o
|
||||||
n
|
n
|
||||||
p
|
p
|
||||||
|
@ -26,17 +26,18 @@ p
|
||||||
|
|
||||||
a
|
a
|
||||||
w
|
w
|
||||||
EOF > /dev/null || exit 1
|
EOF
|
||||||
echo "> created DOS partition table on $disk with one bootable partition."
|
if [ $? != 0 ] ; then exit 1 ; fi
|
||||||
sudo mkfs.ext4 $disk*1 || exit 1 # /dev/sda 1 or /dev/nvme0n1 p1 => *1 instead of just 1
|
echo "> created DOS partition table on $drive with one bootable partition."
|
||||||
|
sudo mkfs.ext4 $drive*1 || exit 1 # /dev/sda 1 or /dev/nvme0n1 p1 => *1 instead of just 1
|
||||||
echo "> formatted."
|
echo "> formatted."
|
||||||
sudo mount $disk*1 /mnt || exit 1
|
sudo mount $drive*1 /mnt || exit 1
|
||||||
echo "> mounted."
|
echo "> mounted."
|
||||||
echo "> generating config"
|
echo "> generating config"
|
||||||
sudo nixos-generate-config --root /mnt
|
sudo nixos-generate-config --root /mnt
|
||||||
cd /mnt/etc/nixos
|
cd /mnt/etc/nixos
|
||||||
echo -n "hostname: "
|
echo -n "hostname: "
|
||||||
sudo sed -i -E "s/^}\$/ boot.loader.grub.device = \"\/dev\/$disk\";\n networking.hostName = \"$(head -n1)\";\n}/" hardware-configuration.nix
|
sudo sed -i -E "s/^}\$/ boot.loader.grub.device = \"\/dev\/$drive\";\n networking.hostName = \"$(head -n1)\";\n}/" hardware-configuration.nix
|
||||||
echo "> installing git"
|
echo "> installing git"
|
||||||
nix-env -i git > /dev/null || exit 1
|
nix-env -i git > /dev/null || exit 1
|
||||||
echo "> downloading tudbut/nix-setup"
|
echo "> downloading tudbut/nix-setup"
|
||||||
|
|
Loading…
Add table
Reference in a new issue