chore: reorder and add comments to make code cleaner

This commit is contained in:
Aaron Honeycutt 2024-02-01 10:32:34 -07:00
parent eea3b738ec
commit 2704e92aea

View file

@ -2,34 +2,34 @@
# then sets it as a variable for hibernation support # then sets it as a variable for hibernation support
ramTotal=$(free -h | awk '/^Mem:/{print $2}'| awk -FG {'print$1'}) ramTotal=$(free -h | awk '/^Mem:/{print $2}'| awk -FG {'print$1'})
# Detect and list the drives.
lsblk -f
# Step 1: Choosing the drive for the installation # Step 1: Choosing the drive for the installation
# Choice the drive to use : ## Detect and list the drives.
lsblk -f
## Choice the drive to use :
echo "----------" echo "----------"
echo "Which drive do we want to use for this installation?" echo "Which drive do we want to use for this installation?"
echo "For example /dev/sda or /dev/nvme0n1" echo "For example /dev/sda or /dev/nvme0n1"
read driveName read driveName
# Download Disko file ## Download Disko file
cd /tmp cd /tmp
curl https://gitlab.com/ahoneybun/nix-configs/-/raw/main/partitions/luks-btrfs-subvolumes.nix -o /tmp/disko-config.nix curl https://gitlab.com/ahoneybun/nix-configs/-/raw/main/partitions/luks-btrfs-subvolumes.nix -o /tmp/disko-config.nix
# Replace drive in Disko file ## Replace drive in Disko file
sudo sed -i "s#/dev/sda#$driveName#g" /tmp/disko-config.nix sudo sed -i "s#/dev/sda#$driveName#g" /tmp/disko-config.nix
# Step 2: Partitioning the drive used for the installation # Step 2: Partitioning the drive used for the installation
# Run Disko to partition the disk ## Run Disko to partition the disk
sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /tmp/disko-config.nix sudo nix --experimental-features "nix-command flakes" run github:nix-community/disko -- --mode disko /tmp/disko-config.nix
# Generate Nix configuration ## Generate Nix configuration
sudo nixos-generate-config --no-filesystems --root /mnt sudo nixos-generate-config --no-filesystems --root /mnt
sudo mv /tmp/disko-config.nix /mnt/etc/nixos sudo mv /tmp/disko-config.nix /mnt/etc/nixos
# Downloads and places the predefinded generic flake to use ## Downloads and places the predefinded generic flake to use
curl https://gitlab.com/ahoneybun/nix-configs/-/raw/main/flake.nix > flake.nix; sudo mv -f flake.nix /mnt/etc/nixos/ curl https://gitlab.com/ahoneybun/nix-configs/-/raw/main/flake.nix > flake.nix; sudo mv -f flake.nix /mnt/etc/nixos/
curl https://gitlab.com/ahoneybun/nix-configs/-/raw/main/configuration.nix > configuration.nix; sudo mv -f configuration.nix /mnt/etc/nixos/ curl https://gitlab.com/ahoneybun/nix-configs/-/raw/main/configuration.nix > configuration.nix; sudo mv -f configuration.nix /mnt/etc/nixos/
curl https://gitlab.com/ahoneybun/nix-configs/-/raw/main/home.nix > home.nix; sudo mv -f home.nix /mnt/etc/nixos/ curl https://gitlab.com/ahoneybun/nix-configs/-/raw/main/home.nix > home.nix; sudo mv -f home.nix /mnt/etc/nixos/