Skip to content

Instantly share code, notes, and snippets.

@domenkozar
Created August 5, 2021 12:22
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save domenkozar/c1da433406807255f9aa835d72976470 to your computer and use it in GitHub Desktop.
Save domenkozar/c1da433406807255f9aa835d72976470 to your computer and use it in GitHub Desktop.
Thinkpad P14s NixOS installation
wpa_supplicant -B -i interface -c <(wpa_passphrase 'SSID' 'key').
ping 1.1.1.1
parted /dev/nvme0n1 -- mklabel gpt
parted /dev/nvme0n1 -- mkpart primary 512MiB -0
parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 512MiB
parted /dev/nvme0n1 -- set 2 esp on
cryptsetup luksFormat /dev/nvme0n1p1
cryptsetup luksOpen /dev/nvme0n1p1 encryptedroot
mkfs.btrfs -L nixos /dev/mapper/encryptedroot
mkfs.fat -F 32 -n boot /dev/nvme0n1p2
mount /dev/disk/by-label/nixos /mnt
mkdir /mnt/boot
mount /dev/nvme0n1p2 /mnt/boot
nixos-generate-config --root /mnt
nixos-install
@knedlsepp
Copy link

knedlsepp commented Jan 5, 2022

I bought the same machine and used your partitioning scheme. I'm curious if you have working hibernation. My box only goes to suspend when the lid is closed and pretty much uses up the entire battery in a day of it being closed. Is that due to missing swap?

@domenkozar
Copy link
Author

There's a new approach to suspending (aimed to be low-power) that needs to be figured out how to enable it.

https://www.intel.com/content/www/us/en/develop/documentation/vtune-help/top/reference/energy-analysis-metrics-reference/s0ix-states.html

@knedlsepp
Copy link

So I'm probably not looking for hibernate but a better suspend. Thx for the pointer.

@atomotic
Copy link

Have you found an optimal suspend configuration?
I have a Lenovo X1 Carbon, the latest, and still suspend drains the whole battery in less than a day.
I am using this trick now, go to hibernate after 60 min of suspend, it works but is quite annoying sometimes:
https://gist.github.com/mattdenner/befcf099f5cfcc06ea04dcdd4969a221

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