diff --git a/hosts/Infini-DESKTOP/install.bash b/hosts/Infini-DESKTOP/install.bash index 8adab63..385a9fa 100755 --- a/hosts/Infini-DESKTOP/install.bash +++ b/hosts/Infini-DESKTOP/install.bash @@ -3,7 +3,7 @@ # [[[[file:/etc/nixos/hosts/Infini-DESKTOP/readme.org::mount][mount]]][mount]] # [[[[file:/etc/nixos/hosts/Infini-DESKTOP/readme.org::boilerplate][boilerplate]]][boilerplate]] DISK=$1 -PARTITION_PREFIX="p" +PARTITION_PREFIX=$2 sudo mkdir -p /mnt # boilerplate ends here diff --git a/hosts/Infini-DESKTOP/mount.bash b/hosts/Infini-DESKTOP/mount.bash index 5328d94..1f32e48 100755 --- a/hosts/Infini-DESKTOP/mount.bash +++ b/hosts/Infini-DESKTOP/mount.bash @@ -2,7 +2,7 @@ # [[file:readme.org::mount][mount]] # [[[[file:/etc/nixos/hosts/Infini-DESKTOP/readme.org::boilerplate][boilerplate]]][boilerplate]] DISK=$1 -PARTITION_PREFIX="p" +PARTITION_PREFIX=$2 sudo mkdir -p /mnt # boilerplate ends here diff --git a/hosts/Infini-DESKTOP/prep.bash b/hosts/Infini-DESKTOP/prep.bash index 151f4dd..2697d2c 100755 --- a/hosts/Infini-DESKTOP/prep.bash +++ b/hosts/Infini-DESKTOP/prep.bash @@ -2,7 +2,7 @@ # [[file:readme.org::preparation][preparation]] # [[[[file:/etc/nixos/hosts/Infini-DESKTOP/readme.org::boilerplate][boilerplate]]][boilerplate]] DISK=$1 -PARTITION_PREFIX="p" +PARTITION_PREFIX=$2 sudo mkdir -p /mnt # boilerplate ends here diff --git a/hosts/Infini-DESKTOP/readme.org b/hosts/Infini-DESKTOP/readme.org index e115dc2..ac644be 100644 --- a/hosts/Infini-DESKTOP/readme.org +++ b/hosts/Infini-DESKTOP/readme.org @@ -61,7 +61,7 @@ Setup for my main desktop computer, using an Nvidia GPU and the =desktop= form f #+NAME: boilerplate #+BEGIN_SRC bash DISK=$1 -PARTITION_PREFIX="p" +PARTITION_PREFIX=$2 sudo mkdir -p /mnt #+END_SRC diff --git a/hosts/Infini-SERVER/install.bash b/hosts/Infini-SERVER/install.bash index 00fe4c1..d436bd1 100755 --- a/hosts/Infini-SERVER/install.bash +++ b/hosts/Infini-SERVER/install.bash @@ -3,6 +3,7 @@ # [[[[file:/etc/nixos/hosts/Infini-SERVER/readme.org::mount][mount]]][mount]] # [[[[file:/etc/nixos/hosts/Infini-SERVER/readme.org::boilerplate][boilerplate]]][boilerplate]] DISK=$1 +PARTITION_PREFIX=$2 sudo mkdir -p /mnt # boilerplate ends here @@ -20,9 +21,9 @@ sudo mount -t tmpfs root /mnt echo "LOG: - Mounting persistent directories" sudo mkdir -p /mnt/persist /mnt/nix /mnt/boot -sudo mount -o subvol=root,autodefrag,noatime "${DISK}2" /mnt/persist -sudo mount -o subvol=nix,autodefrag,noatime "${DISK}2" /mnt/nix -sudo mount -o subvol=boot,autodefrag,noatime "${DISK}2" /mnt/boot +sudo mount -o subvol=root,autodefrag,noatime "${DISK}${PARTITION_PREFIX}2" /mnt/persist +sudo mount -o subvol=nix,autodefrag,noatime "${DISK}${PARTITION_PREFIX}2" /mnt/nix +sudo mount -o subvol=boot,autodefrag,noatime "${DISK}${PARTITION_PREFIX}2" /mnt/boot echo "LOG: - - Mounting persistent subdirectories" sudo mkdir -p /mnt/home @@ -30,7 +31,7 @@ sudo mount --bind /mnt/persist/home /mnt/home echo "LOG: - Mounting EFI System Partition" sudo mkdir -p /mnt/boot/efi -sudo mount "${DISK}1" /mnt/boot/efi +sudo mount "${DISK}${PARTITION_PREFIX}1" /mnt/boot/efi # mounting ends here # mount ends here diff --git a/hosts/Infini-SERVER/mount.bash b/hosts/Infini-SERVER/mount.bash index 6cba929..3eb79b3 100755 --- a/hosts/Infini-SERVER/mount.bash +++ b/hosts/Infini-SERVER/mount.bash @@ -2,6 +2,7 @@ # [[file:readme.org::mount][mount]] # [[[[file:/etc/nixos/hosts/Infini-SERVER/readme.org::boilerplate][boilerplate]]][boilerplate]] DISK=$1 +PARTITION_PREFIX=$2 sudo mkdir -p /mnt # boilerplate ends here @@ -19,9 +20,9 @@ sudo mount -t tmpfs root /mnt echo "LOG: - Mounting persistent directories" sudo mkdir -p /mnt/persist /mnt/nix /mnt/boot -sudo mount -o subvol=root,autodefrag,noatime "${DISK}2" /mnt/persist -sudo mount -o subvol=nix,autodefrag,noatime "${DISK}2" /mnt/nix -sudo mount -o subvol=boot,autodefrag,noatime "${DISK}2" /mnt/boot +sudo mount -o subvol=root,autodefrag,noatime "${DISK}${PARTITION_PREFIX}2" /mnt/persist +sudo mount -o subvol=nix,autodefrag,noatime "${DISK}${PARTITION_PREFIX}2" /mnt/nix +sudo mount -o subvol=boot,autodefrag,noatime "${DISK}${PARTITION_PREFIX}2" /mnt/boot echo "LOG: - - Mounting persistent subdirectories" sudo mkdir -p /mnt/home @@ -29,6 +30,6 @@ sudo mount --bind /mnt/persist/home /mnt/home echo "LOG: - Mounting EFI System Partition" sudo mkdir -p /mnt/boot/efi -sudo mount "${DISK}1" /mnt/boot/efi +sudo mount "${DISK}${PARTITION_PREFIX}1" /mnt/boot/efi # mounting ends here # mount ends here diff --git a/hosts/Infini-SERVER/prep.bash b/hosts/Infini-SERVER/prep.bash index 1136f49..95c7b99 100755 --- a/hosts/Infini-SERVER/prep.bash +++ b/hosts/Infini-SERVER/prep.bash @@ -2,6 +2,7 @@ # [[file:readme.org::preparation][preparation]] # [[[[file:/etc/nixos/hosts/Infini-SERVER/readme.org::boilerplate][boilerplate]]][boilerplate]] DISK=$1 +PARTITION_PREFIX=$2 sudo mkdir -p /mnt # boilerplate ends here @@ -19,17 +20,17 @@ sudo parted $DISK -s -- set 1 esp on # [[[[file:/etc/nixos/hosts/Infini-SERVER/readme.org::filesystems][filesystems]]][filesystems]] echo "LOG: Making filesystems" -echo "- Making fat32 filesystem on ${DISK}1" -sudo mkfs.fat -F 32 -n boot "${DISK}1" -echo "- Making btrfs filesystem on ${DISK}2" -sudo mkfs.btrfs "${DISK}2" -L "Infini-SERVER" -f -echo "- Making swap space on ${DISK}3" -sudo mkswap -L swap "${DISK}3" +echo "- Making fat32 filesystem on ${DISK}${PARTITION_PREFIX}1" +sudo mkfs.fat -F 32 -n boot "${DISK}${PARTITION_PREFIX}1" +echo "- Making btrfs filesystem on ${DISK}${PARTITION_PREFIX}2" +sudo mkfs.btrfs "${DISK}${PARTITION_PREFIX}2" -L "Infini-SERVER" -f +echo "- Making swap space on ${DISK}${PARTITION_PREFIX}3" +sudo mkswap -L swap "${DISK}${PARTITION_PREFIX}3" # filesystems ends here # [[[[file:/etc/nixos/hosts/Infini-SERVER/readme.org::subvolumes][subvolumes]]][subvolumes]] -echo "LOG: Making subvolumes on ${DISK}2" -sudo mount "${DISK}2" /mnt +echo "LOG: Making subvolumes on ${DISK}${PARTITION_PREFIX}2" +sudo mount "${DISK}${PARTITION_PREFIX}2" /mnt sudo btrfs subvolume create /mnt/root sudo btrfs subvolume create /mnt/root/home sudo mkdir -p /mnt/root/etc diff --git a/hosts/Infini-SERVER/readme.org b/hosts/Infini-SERVER/readme.org index cc548d6..a454053 100644 --- a/hosts/Infini-SERVER/readme.org +++ b/hosts/Infini-SERVER/readme.org @@ -61,6 +61,7 @@ Setup for my main server hosting computer, using an Nvidia GPU and the =server= #+NAME: boilerplate #+BEGIN_SRC bash DISK=$1 +PARTITION_PREFIX=$2 sudo mkdir -p /mnt #+END_SRC @@ -90,20 +91,20 @@ sudo parted $DISK -s -- set 1 esp on #+NAME: filesystems #+BEGIN_SRC bash echo "LOG: Making filesystems" -echo "- Making fat32 filesystem on ${DISK}1" -sudo mkfs.fat -F 32 -n boot "${DISK}1" -echo "- Making btrfs filesystem on ${DISK}2" -sudo mkfs.btrfs "${DISK}2" -L "Infini-SERVER" -f -echo "- Making swap space on ${DISK}3" -sudo mkswap -L swap "${DISK}3" +echo "- Making fat32 filesystem on ${DISK}${PARTITION_PREFIX}1" +sudo mkfs.fat -F 32 -n boot "${DISK}${PARTITION_PREFIX}1" +echo "- Making btrfs filesystem on ${DISK}${PARTITION_PREFIX}2" +sudo mkfs.btrfs "${DISK}${PARTITION_PREFIX}2" -L "Infini-SERVER" -f +echo "- Making swap space on ${DISK}${PARTITION_PREFIX}3" +sudo mkswap -L swap "${DISK}${PARTITION_PREFIX}3" #+END_SRC ** Making Subvolumes #+NAME: subvolumes #+BEGIN_SRC bash -echo "LOG: Making subvolumes on ${DISK}2" -sudo mount "${DISK}2" /mnt +echo "LOG: Making subvolumes on ${DISK}${PARTITION_PREFIX}2" +sudo mount "${DISK}${PARTITION_PREFIX}2" /mnt sudo btrfs subvolume create /mnt/root sudo btrfs subvolume create /mnt/root/home sudo mkdir -p /mnt/root/etc @@ -123,9 +124,9 @@ sudo mount -t tmpfs root /mnt echo "LOG: - Mounting persistent directories" sudo mkdir -p /mnt/persist /mnt/nix /mnt/boot -sudo mount -o subvol=root,autodefrag,noatime "${DISK}2" /mnt/persist -sudo mount -o subvol=nix,autodefrag,noatime "${DISK}2" /mnt/nix -sudo mount -o subvol=boot,autodefrag,noatime "${DISK}2" /mnt/boot +sudo mount -o subvol=root,autodefrag,noatime "${DISK}${PARTITION_PREFIX}2" /mnt/persist +sudo mount -o subvol=nix,autodefrag,noatime "${DISK}${PARTITION_PREFIX}2" /mnt/nix +sudo mount -o subvol=boot,autodefrag,noatime "${DISK}${PARTITION_PREFIX}2" /mnt/boot echo "LOG: - - Mounting persistent subdirectories" sudo mkdir -p /mnt/home @@ -133,7 +134,7 @@ sudo mount --bind /mnt/persist/home /mnt/home echo "LOG: - Mounting EFI System Partition" sudo mkdir -p /mnt/boot/efi -sudo mount "${DISK}1" /mnt/boot/efi +sudo mount "${DISK}${PARTITION_PREFIX}1" /mnt/boot/efi #+END_SRC ** Installing