chore(guide): add corrections and updates to the install guide

This commit is contained in:
2026-10-02 17:33:34 +02:00
parent 006290ef05
commit fc4f0afc46
+20 -9
View File
@@ -2,8 +2,13 @@
- The installations presented in this repository are always luks encrypted - The installations presented in this repository are always luks encrypted
- For simplicity I'm using device labels rather than uuids - For simplicity I'm using device labels rather than uuids
- Secure Boot has to be disabled in the firmware, the installer iso isn't signed
1. the partitioning layout should look somewhat like this after the installation 1. create the partitions with `cfdisk` or `fdisk` (gpt)
- `nvme0n1p1`: 2G, type `EFI System`, otherwise the firmware won't find the bootloader
- `nvme0n1p2`: the rest, type `Linux filesystem`
the layout should look somewhat like this after the installation
```bash ```bash
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 476.9G 0 disk nvme0n1 259:0 0 476.9G 0 disk
@@ -30,12 +35,13 @@ cryptsetup luksOpen /dev/nvme0n1p2 cryptroot
pvcreate /dev/mapper/cryptroot pvcreate /dev/mapper/cryptroot
# create a volume group inside # create a volume group inside
vgcreate lvmroot /dev/mapper/cryptroot vgcreate lvmroot /dev/mapper/cryptroot
# create the swap volume # create the swap volume, half the ram (no hibernation)
lvcreate --size 8G lvmroot --name swap lvcreate --size 16G lvmroot --name swap
# if you desire, create a home volume # if you desire, create a home volume
lvcreate --size 150G lvmroot --name home lvcreate --size 150G lvmroot --name home
# create the root volume # create the root volume, leave some space in the vg to grow volumes later
lvcreate -l 100%FREE lvmroot --name root # (lvextend -r -L +50G lvmroot/home works while mounted)
lvcreate -l 90%FREE lvmroot --name root
# format as usual for root partition # format as usual for root partition
mkfs.ext4 -L "nixroot" /dev/mapper/lvmroot-root mkfs.ext4 -L "nixroot" /dev/mapper/lvmroot-root
@@ -47,7 +53,7 @@ mkswap -L "nixswap" /dev/mapper/lvmroot-swap
# mount root # mount root
mount /dev/disk/by-label/nixroot /mnt mount /dev/disk/by-label/nixroot /mnt
# mount boot # mount boot
mount --mkdir /dev/nvme0n1p1 /mnt/boot mount --mkdir /dev/disk/by-label/nixboot /mnt/boot
# again, if you did the home volume # again, if you did the home volume
mount --mkdir /dev/disk/by-label/nixhome /mnt/home mount --mkdir /dev/disk/by-label/nixhome /mnt/home
# turn on swap # turn on swap
@@ -59,8 +65,7 @@ swapon /dev/disk/by-label/nixswap
# generate templates and update the hardware-configuration.nix # generate templates and update the hardware-configuration.nix
nixos-generate-config --root /mnt nixos-generate-config --root /mnt
# add dm-crypt and dm-mod to the kernelModules # no extra kernelModules needed, luks and lvm load dm_crypt and dm_mod themselves
boot.initrd.kernelModules = [ "dm-crypt" "dm-mod" ];
# add file systems using labels # add file systems using labels
fileSystems."/" = fileSystems."/" =
@@ -81,7 +86,13 @@ swapDevices =
]; ];
# point the bootloader to the luks device # point the bootloader to the luks device
boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/nixcrypt"; boot.initrd.luks.devices."cryptroot" = {
device = "/dev/disk/by-label/nixcrypt";
# without this fstrim never reaches the ssd
allowDiscards = true;
# lower latency on nvme
bypassWorkqueues = true;
};
``` ```
4. install nixos 4. install nixos