Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/Getting Started/NixOS/Root on ZFS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,13 @@ System Installation

#. **LUKS only**: Setup encrypted LUKS container for root pool::

# Use this short bash script to load your password in a variable.
read -p "Password: " -rs P; echo; read -p "Password (repeat): " -rs Q; echo; if [ "$P" == "$Q" ]; then YOUR_PASSWD=$P; else echo "Try again. Passwords are not the same."; fi; unset P Q

for i in ${DISK}; do
# see PASSPHRASE PROCESSING section in cryptsetup(8)
printf "YOUR_PASSWD" | cryptsetup luksFormat --type luks2 "${i}"-part3 -
printf "YOUR_PASSWD" | cryptsetup luksOpen "${i}"-part3 luks-rpool-"${i##*/}"-part3 -
printf "$YOUR_PASSWD" | cryptsetup luksFormat --type luks2 "${i}"-part3 -
printf "$YOUR_PASSWD" | cryptsetup luksOpen "${i}"-part3 luks-rpool-"${i##*/}"-part3 -
done

#. Create boot pool
Expand Down