mirror of
https://gitlab.com/ahoneybun/nyxi-installer.git
synced 2025-05-12 11:04:02 -06:00
Merge branch 'revert-4b779638' into 'nathaniel-btrfs'
Revert "Update install.sh" See merge request ahoneybun/nixos-cli-installer!2
This commit is contained in:
commit
81ad703acf
1 changed files with 28 additions and 30 deletions
58
install.sh
58
install.sh
|
@ -31,9 +31,6 @@ echo 1 # Change first partition to EFI system.
|
||||||
echo w # write changes.
|
echo w # write changes.
|
||||||
) | sudo fdisk $driveName -w always -W always
|
) | sudo fdisk $driveName -w always -W always
|
||||||
|
|
||||||
# Move to root
|
|
||||||
sudo -i
|
|
||||||
|
|
||||||
# List the new partitions.
|
# List the new partitions.
|
||||||
lsblk -f
|
lsblk -f
|
||||||
|
|
||||||
|
@ -48,63 +45,64 @@ echo "Which is the root partition?"
|
||||||
read rootName
|
read rootName
|
||||||
|
|
||||||
# Create EFI partition
|
# Create EFI partition
|
||||||
mkfs.fat -F32 -n EFI $efiName
|
sudo mkfs.fat -F32 -n EFI $efiName
|
||||||
|
|
||||||
# Encrypt the root partition
|
# Encrypt the root partition
|
||||||
cryptsetup luksFormat -v -s 512 -h sha512 $rootName
|
sudo cryptsetup luksFormat -v -s 512 -h sha512 $rootName
|
||||||
|
|
||||||
# Open the encrypted root partition
|
# Open the encrypted root partition
|
||||||
cryptsetup luksOpen $rootName crypt-root
|
sudo cryptsetup luksOpen $rootName crypt-root
|
||||||
|
|
||||||
pvcreate /dev/mapper/crypt-root
|
sudo pvcreate /dev/mapper/crypt-root
|
||||||
vgcreate lvm /dev/mapper/crypt-root
|
sudo vgcreate lvm /dev/mapper/crypt-root
|
||||||
|
|
||||||
lvcreate --size $ramTotal --name swap lvm
|
sudo lvcreate --size $ramTotal --name swap lvm
|
||||||
lvcreate --extents 100%FREE --name root lvm
|
sudo lvcreate --extents 100%FREE --name root lvm
|
||||||
|
|
||||||
cryptsetup config $rootName --label luks
|
sudo cryptsetup config $rootName --label luks
|
||||||
|
|
||||||
mkswap /dev/lvm/swap # swap partition
|
sudo mkswap /dev/lvm/swap # swap partition
|
||||||
mkfs.btrfs -L root /dev/lvm/root # /root partition
|
sudo mkfs.btrfs -L root /dev/lvm/root # /root partition
|
||||||
|
|
||||||
# 0. Mount the filesystems.
|
# 0. Mount the filesystems.
|
||||||
swapon /dev/lvm/swap
|
sudo swapon /dev/lvm/swap
|
||||||
mount /dev/lvm/root /mnt
|
sudo mount /dev/lvm/root /mnt
|
||||||
|
|
||||||
# Create Subvolumes
|
# Create Subvolumes
|
||||||
btrfs subvolume create /mnt/@
|
sudo btrfs subvolume create /mnt/@
|
||||||
btrfs subvolume create /mnt/@home
|
sudo btrfs subvolume create /mnt/@home
|
||||||
|
|
||||||
# Unmount root
|
# Unmount root
|
||||||
umount /mnt
|
sudo umount /mnt
|
||||||
|
|
||||||
# Mount the subvolumes.
|
# Mount the subvolumes.
|
||||||
mount -o noatime,commit=120,compress=zstd:10,space_cache,subvol=@ /dev/lvm/root /mnt
|
sudo mount -o noatime,commit=120,compress=zstd:10,space_cache,subvol=@ /dev/lvm/root /mnt
|
||||||
|
|
||||||
mkdir /mnt/home/
|
sudo mkdir /mnt/home/
|
||||||
mount -o noatime,commit=120,compress=zstd:10,space_cache,subvol=@home /dev/lvm/root /mnt/home
|
sudo mount -o noatime,commit=120,compress=zstd:10,space_cache,subvol=@home /dev/lvm/root /mnt/home
|
||||||
|
|
||||||
# Mount the EFI partition.
|
# Mount the EFI partition.
|
||||||
mkdir /mnt/boot/
|
sudo mkdir /mnt/boot/
|
||||||
mount $efiName /mnt/boot
|
sudo mount $efiName /mnt/boot
|
||||||
|
|
||||||
# Generate Nix configuration
|
# Generate Nix configuration
|
||||||
nixos-generate-config --root /mnt
|
sudo nixos-generate-config --root /mnt
|
||||||
|
|
||||||
curl https://gitlab.com/ahoneybun/nixos-cli-installer/-/raw/nathaniel-btrfs/config-plasma.nix > configuration.nix; sudo mv -f configuration.nix /mnt/etc/nixos/
|
curl https://gitlab.com/ahoneybun/nixos-cli-installer/-/raw/nathaniel-btrfs/config-plasma.nix > configuration.nix; sudo mv -f configuration.nix /mnt/etc/nixos/
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
nixos-install
|
sudo nixos-install
|
||||||
|
|
||||||
# Start Setup section
|
# Start Setup section
|
||||||
|
sudo -i
|
||||||
curl https://gitlab.com/ahoneybun/nixos-cli-installer/-/raw/nathaniel-btrfs/setup.sh > /mntsetup.sh
|
curl https://gitlab.com/ahoneybun/nixos-cli-installer/-/raw/nathaniel-btrfs/setup.sh > /mntsetup.sh
|
||||||
|
|
||||||
# Enter into installed OS
|
# Enter into installed OS
|
||||||
mount -o bind /dev /mnt/dev
|
sudo mount -o bind /dev /mnt/dev
|
||||||
mount -o bind /proc /mnt/proc
|
sudo mount -o bind /proc /mnt/proc
|
||||||
mount -o bind /sys /mnt/sys
|
sudo mount -o bind /sys /mnt/sys
|
||||||
chroot /mnt /nix/var/nix/profiles/system/activate
|
sudo chroot /mnt /nix/var/nix/profiles/system/activate
|
||||||
chroot /mnt /run/current-system/sw/bin/bash setup.sh
|
sudo chroot /mnt /run/current-system/sw/bin/bash setup.sh
|
||||||
|
|
||||||
# Removed install script.
|
# Removed install script.
|
||||||
rm install.sh
|
rm install.sh
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue