diff --git a/README.md b/README.md index a6e56e3..78c7a02 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ $ sudo nixos-rebuild switch --flake --upgrade path:/home/aaron/git/nixconfig#def ## basic system installation +1. the partitioning layout will look like this. + ```bash NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 233.8G 0 disk @@ -26,6 +28,8 @@ sda 8:0 0 233.8G 0 disk └─vg-root 254:2 0 225.3G 0 lvm / ``` +2. prepare the installation + ```bash # format the boot partition mkfs.fat -F 32 /dev/sda1 -n "nixboot" @@ -62,6 +66,45 @@ mount --mkdir /dev/disk/by-label/nixhome /mnt/home swapon /dev/disk/by-label/nixswap ``` +3. prepare nixos + + +```bash +# generate templates and update the hardware-configuration.nix +sudo nixos-generate-config --root /mnt + +# add cryptd to the kernelModules +boot.initrd.kernelModules = [ "dm-snapshot" "cryptd" ]; + +# add file systems using labels +fileSystems."/" = + { device = "/dev/disk/by-label/nixroot"; + fsType = "ext4"; + }; +fileSystems."/boot" = + { device = "/dev/disk/by-label/nixboot"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; +fileSystems."/home" = + { device = "/dev/disk/by-label/nixhome"; + fsType = "ext4"; + }; +swapDevices = + [ { device = "/dev/disk/by-label/nixswap"; } + ]; + +# point the bootloader to the luks device +boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-label/nixcrypt"; +``` + +4. install nixos + +```bash +cd /mnt +sudo nixos-install +``` + ## author aaron