I wanted to document this for anyone else who's not super familiar with qmk and wants to get a setup working with the kb2040. Here are the steps I followed:
Design a layout on QMK Configurator
Export the json, e.g. to ~/Downloads/my_custom_keymap.json
Setup QMK on your computer
sudo apt install python3-pip
pip3 install qmk
And setup the keymap
cp default foo
mv keymap.c keymap.c.defaultl
qmk json2c ~/Downloads/my_custom_keymap.json > keymap.c
Then build the firmware and flash it!
The secret sauce here was "CONVERT_TO=kb2040" - I didn't have to modify anything else, it just did what was needed to make this compatible with the kb2040 microcontrollers.
qmk flash -kb crkbd -km foo -e CONVERT_TO=kb2040
Press the boot button on the mcu, plug it into usb, and it should flash. You can run it again for the second half of the kb, or just drag the .df2 over to it.