.. highlight:: sh Optional Configuration ====================== .. contents:: Table of Contents :local: Skip to `System Installation <./4-system-installation.html>`__ section if no optional configuration is needed. Mail notification for ZFS status ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For headless applications such as NAS, it is useful to set up mail notification for hardware changes and monitor for scrub results. #. Set up an alias for root account:: tee -a /state/etc/aliases <> /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} <