You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

45 lines
1.1 KiB

  1. # NOTE: First check that the disk driver is set to virtio!
  2. fdisk /dev/sda
  3. o
  4. n p <enter> <enter> +1G
  5. # boot partition
  6. n p <enter> <enter> <enter>
  7. # LVM partition
  8. a 1
  9. # set bootable
  10. w
  11. # Boot partition
  12. mkfs.ext4 -L boot /dev/sda1
  13. # LVM partition
  14. pvcreate /dev/sda2
  15. vgcreate vg_main /dev/sda2
  16. lvcreate -L 2GB -n lv_swap vg_main
  17. lvcreate -l 100%FREE -n lv_root vg_main
  18. mkswap -L swap /dev/vg_main/lv_swap
  19. swapon /dev/vg_main/lv_swap
  20. mkfs.ext4 -L nixos /dev/vg_main/lv_root
  21. mount /dev/vg_main/lv_root /mnt
  22. mkdir /mnt/boot
  23. mount /dev/sda1 /mnt/boot
  24. # NixOS installation
  25. nixos-generate-config --root /mnt
  26. curl https://git.cryto.net/joepie91/morph-rc/raw/master/data/dummy-configuration.nix > /mnt/etc/nixos/configuration.nix
  27. # NOTE: Potentially update configuration.nix at this point if the primary disk is not /dev/sda!
  28. nixos-install
  29. # NOTE: Don't forget to set a better root password over SSH after restarting
  30. # NOTE: Don't forget to run ./deploy-secrets if needed!
  31. #################################
  32. # Resize LV to maximum available space:
  33. lvresize --resizefs -l +100%FREE /dev/vg_main/lv_root