To enable persistent flash storage, use the following configuration:
CONFIG_APP_STORAGE=y
CONFIG_APP_STORAGE_BACKEND_LITTLEFS=y
# Adjust for your needs
CONFIG_APP_STORAGE_MAX_RECORDS_PER_TYPE=16
CONFIG_APP_STORAGE_THREAD_STACK_SIZE=4000
You configure the partition size in devicetree, as described in Partition sizing. The default littlefs_storage partition is 1 MiB on both the Thingy:91 X and the nRF9151 DK.