I have NixOS on my Raspberry Pi 4. Things are working pretty well except that the I2C bus is not initialized. I can add this to my /boot/config.txt manually and do the required modprobes to get the i2c devices to appear and be usable, but I’ve like to rebuild NixOS with this set up automatically.
What do I need to add to my configuration.nix file to get the config.txt updated and then the kernel drivers loaded at boot-time? I can see that config.txt is being overwritten when I rebuild NixOS.
Note for anyone who passes through here looking for I2C config tips like I did:
I added an option to turn the bus on with a one-liner over here:
This is built on top of the device-tree.overlays work above. Should work for anyone building their device tree via NixOS settings, and importantly makes it easy to do if you’re using uboot rather than the stock Pi bootloader.