Skip to content

Instantly share code, notes, and snippets.

@lnlsn
Forked from martijnvermaat/nixos.md
Created January 24, 2021 11:15
Show Gist options
  • Select an option

  • Save lnlsn/2723d2b77a9fd272caf0c85c4eeb7c71 to your computer and use it in GitHub Desktop.

Select an option

Save lnlsn/2723d2b77a9fd272caf0c85c4eeb7c71 to your computer and use it in GitHub Desktop.
Installation of NixOS with encrypted root

Windows license: EULAID:T1C_2R_1_ED_CC_O_en-us

http://chris-martin.org/2015/installing-nixos https://earldouglas.com/notes/linux.html https://bluishcoder.co.nz/2014/05/14/installing-nixos-with-encrypted-root-on-thinkpad-w540.html

https://nixos.org/releases/nixos/16.03/nixos-16.03.678.2597f52/nixos-minimal-16.03.678.2597f52-x86_64-linux.iso

sudo dd bs=4M if=nixos-minimal-16.03.678.2597f52-x86_64-linux.iso of=/dev/sdb

Enable USB legacy boot (instead of or in addition to UEFI)

https://bugzilla.kernel.org/show_bug.cgi?id=110941

Boot with kernel parameter intel_pstate=no_hwp

gdisk /dev/sda
  o (create new empty partition table)
  n (add partition, 500M, type ef00 EFI)
  n (add partition, remaining space, type 8300 Linux LVM)
  w (write partition table and exit)
cryptsetup luksFormat /dev/sda2
cryptsetup luksOpen /dev/sda2 enc-pv
pvcreate /dev/mapper/enc-pv
vgcreate vg /dev/mapper/enc-pv
lvcreate -L 8G -n swap vg
lvcreate -l '100%FREE' -n root vg
mkfs.fat /dev/sda1
mkfs.ext4 -L root /dev/vg/root
mkswap -L swap /dev/vg/swap
mount /dev/vg/root /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
swapon /dev/vg/swap

Create /etc/wpa_supplicant.conf:

network={
  ssid="****"
  psk="****"
}

Then systemctl start wpa_supplicant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment