.. highlight:: sh Optional Configuration ====================== .. contents:: Table of Contents :local: Skip to `System Installation <./4-system-installation.html>`__ section if no optional configuration is needed. Supply password with SSH ~~~~~~~~~~~~~~~~~~~~~~~~ Note: if you choose to encrypt boot pool, where decryption is handled by GRUB, as described in the next section, configuration performed in this section will have no effect. This example uses DHCP:: mkdir -p /mnt/etc/state/ssh/ ssh-keygen -t ed25519 -N "" -f /mnt/state/etc/ssh/ssh_host_initrd_ed25519_key tee -a /mnt/etc/nixos/${INST_CONFIG_FILE} <> /root/.profile ''; }; }; EOF Encrypt boot pool ~~~~~~~~~~~~~~~~~~~ Note: This will disable password with SSH. The password previously set for root pool will be replaced by keyfile, embedded in initrd. #. Add package:: tee -a /mnt/etc/nixos/${INST_CONFIG_FILE} < /mnt/root/bpool_$INST_UUID-${INST_ID}-pre-luks #. Unmount EFI partition:: for i in ${DISK}; do umount /mnt/boot/efis/${i##*/}-part1 done #. Destroy boot pool:: zpool destroy bpool_$INST_UUID #. Create LUKS containers:: for i in ${DISK}; do cryptsetup luksFormat -q --type luks1 --key-file /mnt/etc/cryptkey.d/bpool_$INST_UUID-key-luks $i-part2 echo $LUKS_PWD | cryptsetup luksAddKey --key-file /mnt/etc/cryptkey.d/bpool_$INST_UUID-key-luks $i-part2 cryptsetup open ${i}-part2 ${i##*/}-part2-luks-bpool_$INST_UUID --key-file /mnt/etc/cryptkey.d/bpool_$INST_UUID-key-luks tee -a /mnt/etc/nixos/${INST_CONFIG_FILE} <