From 9ebb3ddc4932864ef80b0d17612fc137e6a2316a Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 12:55:32 -0600 Subject: [PATCH 01/21] clean up code a bit --- install.sh | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/install.sh b/install.sh index 00b104c..f5a0543 100644 --- a/install.sh +++ b/install.sh @@ -1,24 +1,6 @@ -# This file is used to partition, mount and install arch linux on UEFI systems. - -# Default keyboard layout is US. -# To change layout : -# 1. Use `localectl list-keymaps` to display liste of keymaps. -# 2. Use `loadkeys [keymap]` to set keyboard layout. -# ex : `loadkeys de-latin1` to set a german keyboard layout. - -# Figure out how much RAM the system has an set a variable -# ramTotal=$(grep MemTotal /proc/meminfo | awk '{print $2 / 1024 / 1024}') -ramTotal=$(free | awk '/^Mem:/{print $2 / 1024 / 1024}' | awk -F. {'print$1'}) - -# Update system clock. -# timedatectl set-ntp true - # Load kernel modules -# modprobe dm-crypt -# modprobe dm-mod - -# Switch to root -# sudo -i +modprobe dm-crypt +modprobe dm-mod # Detect and list the drives. lsblk -f @@ -72,10 +54,10 @@ echo "Which is the swap partition?" read swapName # Encrypt the root partition -# sudo cryptsetup luksFormat -v -s 512 -h sha512 $rootName +sudo cryptsetup luksFormat -v -s 512 -h sha512 $rootName # Open the encrypted root partition -# sudo cryptsetup luksOpen $rootName crypt-root +sudo cryptsetup luksOpen $rootName crypt-root sudo mkfs.fat -F32 -n EFI $efiName # EFI partition sudo mkfs.ext4 -L root $rootName # / partition From 30492245752bfa353997a84b6fb267a8117f717e Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 19:03:13 +0000 Subject: [PATCH 02/21] Update install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index f5a0543..54de424 100644 --- a/install.sh +++ b/install.sh @@ -64,7 +64,7 @@ sudo mkfs.ext4 -L root $rootName # / partition sudo mkswap -L swap $swapName # swap partition # 0. Mount the filesystems. -sudo mount $rootName /mnt +mount /dev/mapper/crypt-root /mnt sudo swapon $swapName # 1. Create directory to mount EFI partition. From e06d5289890afbec87a568e27130aade0e42ff22 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 19:05:24 +0000 Subject: [PATCH 03/21] Update install.sh --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 54de424..99c931b 100644 --- a/install.sh +++ b/install.sh @@ -59,9 +59,9 @@ sudo cryptsetup luksFormat -v -s 512 -h sha512 $rootName # Open the encrypted root partition sudo cryptsetup luksOpen $rootName crypt-root -sudo mkfs.fat -F32 -n EFI $efiName # EFI partition -sudo mkfs.ext4 -L root $rootName # / partition -sudo mkswap -L swap $swapName # swap partition +sudo mkfs.fat -F32 -n EFI $efiName # EFI partition +sudo mkfs.ext4 -L root /dev/mapper/crypt-root # / partition +sudo mkswap -L swap $swapName # swap partition # 0. Mount the filesystems. mount /dev/mapper/crypt-root /mnt From d13995dafcd5f028f96487396ebefc8be6a86e1c Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 19:07:39 +0000 Subject: [PATCH 04/21] Update config-gnome.nix --- config-gnome.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config-gnome.nix b/config-gnome.nix index 2932a33..5e6b377 100644 --- a/config-gnome.nix +++ b/config-gnome.nix @@ -13,6 +13,9 @@ systemd-boot.enable = true; }; + boot.initrd.luks.devices.crypted.device = "/dev/vda2"; + fileSystems."/".device = "/dev/mapper/crypt-root"; + # Name your host machine networking.hostName = "NixOS-VM"; From 4cbff13ba9a4ca79da050527395d6efee3419003 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 19:12:15 +0000 Subject: [PATCH 05/21] Update config-gnome.nix --- config-gnome.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config-gnome.nix b/config-gnome.nix index 5e6b377..ec09a07 100644 --- a/config-gnome.nix +++ b/config-gnome.nix @@ -13,7 +13,7 @@ systemd-boot.enable = true; }; - boot.initrd.luks.devices.crypted.device = "/dev/vda2"; + boot.initrd.luks.devices.crypt-root.device = "/dev/vda2"; fileSystems."/".device = "/dev/mapper/crypt-root"; # Name your host machine From 49a12b0a8246da6e26d289ba137df3c7b7deec93 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 19:16:11 +0000 Subject: [PATCH 06/21] Update install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 99c931b..a7ce3e7 100644 --- a/install.sh +++ b/install.sh @@ -64,7 +64,7 @@ sudo mkfs.ext4 -L root /dev/mapper/crypt-root # / partition sudo mkswap -L swap $swapName # swap partition # 0. Mount the filesystems. -mount /dev/mapper/crypt-root /mnt +sudo mount /dev/disk/by-label/nixos /mnt sudo swapon $swapName # 1. Create directory to mount EFI partition. From 9bcc89633ed4a7d1fff0468540392142cb772bda Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 19:17:12 +0000 Subject: [PATCH 07/21] Update config-gnome.nix --- config-gnome.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/config-gnome.nix b/config-gnome.nix index ec09a07..5922301 100644 --- a/config-gnome.nix +++ b/config-gnome.nix @@ -13,8 +13,12 @@ systemd-boot.enable = true; }; - boot.initrd.luks.devices.crypt-root.device = "/dev/vda2"; - fileSystems."/".device = "/dev/mapper/crypt-root"; + boot.initrd.luks.devices = { + crypted = { + device = "/dev/disk/by-label/root>"; + preLVM = true; + }; + }; # Name your host machine networking.hostName = "NixOS-VM"; From 48dadd42b34b55f9af972050d191935cb5cbcbab Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 19:21:39 +0000 Subject: [PATCH 08/21] Update config-gnome.nix --- config-gnome.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config-gnome.nix b/config-gnome.nix index 5922301..e2989e2 100644 --- a/config-gnome.nix +++ b/config-gnome.nix @@ -14,7 +14,7 @@ }; boot.initrd.luks.devices = { - crypted = { + crypt-root = { device = "/dev/disk/by-label/root>"; preLVM = true; }; From 6e3a9257dd2b8aa0092fe892d6f3f09ea2b51d1e Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 19:48:29 +0000 Subject: [PATCH 09/21] Update config-gnome.nix --- config-gnome.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config-gnome.nix b/config-gnome.nix index e2989e2..bd6f866 100644 --- a/config-gnome.nix +++ b/config-gnome.nix @@ -15,11 +15,16 @@ boot.initrd.luks.devices = { crypt-root = { - device = "/dev/disk/by-label/root>"; + device = "/dev/disk/by-label/root"; preLVM = true; }; }; + fileSystems."/" = + { device = "/dev/disk/by-label/root"; + fsType = "ext4"; + }; + # Name your host machine networking.hostName = "NixOS-VM"; From 4f2917fe23afccd32798aa51c8052ede11e706cb Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 19:51:38 +0000 Subject: [PATCH 10/21] Update install.sh --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index a7ce3e7..a041766 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ # Load kernel modules -modprobe dm-crypt -modprobe dm-mod +sudo modprobe dm-crypt +sudo modprobe dm-mod # Detect and list the drives. lsblk -f From 75c859f33eeb65f2bfeb7b2d54476189fd338922 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 19:52:53 +0000 Subject: [PATCH 11/21] Update install.sh --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a041766..3bc0821 100644 --- a/install.sh +++ b/install.sh @@ -64,7 +64,7 @@ sudo mkfs.ext4 -L root /dev/mapper/crypt-root # / partition sudo mkswap -L swap $swapName # swap partition # 0. Mount the filesystems. -sudo mount /dev/disk/by-label/nixos /mnt +sudo mount /dev/disk/by-label/root /mnt sudo swapon $swapName # 1. Create directory to mount EFI partition. From 55f3f12eec7a57fd4ccd1501053ae620ddb9013c Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@pm.me> Date: Fri, 6 May 2022 15:48:28 -0600 Subject: [PATCH 12/21] Fix ramTotal value --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index 3bc0821..8f7859b 100644 --- a/install.sh +++ b/install.sh @@ -2,6 +2,10 @@ sudo modprobe dm-crypt sudo modprobe dm-mod +# Figure out how much RAM the system has an set a variable +# ramTotal=$(grep MemTotal /proc/meminfo | awk '{print $2 / 1024 / 1024}') +ramTotal=$(free | awk '/^Mem:/{print $2 / 1024 / 1024}' | awk -F. {'print$1'}) + # Detect and list the drives. lsblk -f From f797e1eed3b4926bd3b7c304c2f93d179af0a1f8 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@pm.me> Date: Fri, 6 May 2022 16:12:44 -0600 Subject: [PATCH 13/21] test removing modprobe commands --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 8f7859b..71020c0 100644 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ # Load kernel modules -sudo modprobe dm-crypt -sudo modprobe dm-mod +# sudo modprobe dm-crypt +# sudo modprobe dm-mod # Figure out how much RAM the system has an set a variable # ramTotal=$(grep MemTotal /proc/meminfo | awk '{print $2 / 1024 / 1024}') From 13d37693cd615e6adf4429d9679842073e27c3e4 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@pm.me> Date: Fri, 6 May 2022 16:23:13 -0600 Subject: [PATCH 14/21] Remove unneeded commands --- install.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/install.sh b/install.sh index 71020c0..4c41da7 100644 --- a/install.sh +++ b/install.sh @@ -1,7 +1,3 @@ -# Load kernel modules -# sudo modprobe dm-crypt -# sudo modprobe dm-mod - # Figure out how much RAM the system has an set a variable # ramTotal=$(grep MemTotal /proc/meminfo | awk '{print $2 / 1024 / 1024}') ramTotal=$(free | awk '/^Mem:/{print $2 / 1024 / 1024}' | awk -F. {'print$1'}) From ad4a2d0dd5f0f9b7298c134e4375213934754741 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 22:24:09 +0000 Subject: [PATCH 15/21] Update install.sh --- install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/install.sh b/install.sh index 4c41da7..e5b263a 100644 --- a/install.sh +++ b/install.sh @@ -81,6 +81,16 @@ curl https://gitlab.com/ahoneybun/nixos-cli-installer/-/raw/main/config-gnome.ni # Install sudo nixos-install +# Enter into installed OS +mount -o bind /dev /mnt/dev +mount -o bind /proc /mnt/proc +mount -o bind /sys /mnt/sys +chroot /mnt /nix/var/nix/profiles/system/activate +chroot /mnt /run/current-system/sw/bin/bash + +# Set password for user +passwd aaronh + # Removed downloaded script. rm install.sh From 1ed0bd2ff9dd400b4bbbfd055e6aba7d90d54e0a Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 22:24:36 +0000 Subject: [PATCH 16/21] Update install.sh --- install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index e5b263a..63220ce 100644 --- a/install.sh +++ b/install.sh @@ -91,10 +91,13 @@ chroot /mnt /run/current-system/sw/bin/bash # Set password for user passwd aaronh +# Exit chroot +exit + # Removed downloaded script. rm install.sh # Unmount all filesystems & reboot. -# umount -a -# reboot +umount -a +reboot From df5417adbec5f8b2f5fb149cd6a9fe3656199f24 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 22:35:10 +0000 Subject: [PATCH 17/21] Update install.sh --- install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 63220ce..2979a18 100644 --- a/install.sh +++ b/install.sh @@ -82,11 +82,11 @@ curl https://gitlab.com/ahoneybun/nixos-cli-installer/-/raw/main/config-gnome.ni sudo nixos-install # Enter into installed OS -mount -o bind /dev /mnt/dev -mount -o bind /proc /mnt/proc -mount -o bind /sys /mnt/sys -chroot /mnt /nix/var/nix/profiles/system/activate -chroot /mnt /run/current-system/sw/bin/bash +sudo mount -o bind /dev /mnt/dev +sudo mount -o bind /proc /mnt/proc +sudo mount -o bind /sys /mnt/sys +sudo chroot /mnt /nix/var/nix/profiles/system/activate +sudo chroot /mnt /run/current-system/sw/bin/bash # Set password for user passwd aaronh From 1b60b871cc9da962b4758cfb930ab1808dddec68 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 22:41:54 +0000 Subject: [PATCH 18/21] Update install.sh --- install.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index 2979a18..595243f 100644 --- a/install.sh +++ b/install.sh @@ -82,17 +82,11 @@ curl https://gitlab.com/ahoneybun/nixos-cli-installer/-/raw/main/config-gnome.ni sudo nixos-install # Enter into installed OS -sudo mount -o bind /dev /mnt/dev -sudo mount -o bind /proc /mnt/proc -sudo mount -o bind /sys /mnt/sys -sudo chroot /mnt /nix/var/nix/profiles/system/activate -sudo chroot /mnt /run/current-system/sw/bin/bash - -# Set password for user -passwd aaronh - -# Exit chroot -exit +# sudo mount -o bind /dev /mnt/dev +# sudo mount -o bind /proc /mnt/proc +# sudo mount -o bind /sys /mnt/sys +# sudo chroot /mnt /nix/var/nix/profiles/system/activate +# sudo chroot /mnt /run/current-system/sw/bin/bash # Removed downloaded script. rm install.sh From 0bd77e926ed0512c7f8e2eab32aa94368887966c Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 23:07:10 +0000 Subject: [PATCH 19/21] Update config-gnome.nix --- config-gnome.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config-gnome.nix b/config-gnome.nix index bd6f866..6d12a03 100644 --- a/config-gnome.nix +++ b/config-gnome.nix @@ -13,17 +13,17 @@ systemd-boot.enable = true; }; - boot.initrd.luks.devices = { - crypt-root = { - device = "/dev/disk/by-label/root"; - preLVM = true; - }; - }; +# boot.initrd.luks.devices = { +# crypt-root = { +# device = "/dev/disk/by-label/root"; +# preLVM = true; +# }; +# }; - fileSystems."/" = - { device = "/dev/disk/by-label/root"; - fsType = "ext4"; - }; +# fileSystems."/" = +# { device = "/dev/disk/by-label/root"; +# fsType = "ext4"; +# }; # Name your host machine networking.hostName = "NixOS-VM"; From 98cda079bf2c689f6065ce621763f9499e0dde58 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 23:20:50 +0000 Subject: [PATCH 20/21] Update install.sh --- install.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/install.sh b/install.sh index 595243f..725f9ed 100644 --- a/install.sh +++ b/install.sh @@ -90,8 +90,3 @@ sudo nixos-install # Removed downloaded script. rm install.sh - -# Unmount all filesystems & reboot. -umount -a -reboot - From 1527601c3073443ba2a390c303a399ccf5db56ac Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt <aaronhoneycutt@protonmail.com> Date: Fri, 6 May 2022 23:22:10 +0000 Subject: [PATCH 21/21] Update config-gnome.nix --- config-gnome.nix | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/config-gnome.nix b/config-gnome.nix index 6d12a03..2932a33 100644 --- a/config-gnome.nix +++ b/config-gnome.nix @@ -13,18 +13,6 @@ systemd-boot.enable = true; }; -# boot.initrd.luks.devices = { -# crypt-root = { -# device = "/dev/disk/by-label/root"; -# preLVM = true; -# }; -# }; - -# fileSystems."/" = -# { device = "/dev/disk/by-label/root"; -# fsType = "ext4"; -# }; - # Name your host machine networking.hostName = "NixOS-VM";