How to add header files to avr-gcc for ATmega328PB

While learning about atmega programming a stumbled upon this: addition of support for ATmega328PB to gcc and avrdude.

How would you do changes like that in nix? I experimented with fetchurl and overriding of pkgs.pkgsCross.avr.buildPackages.gcc with something like postInstall (but it doesn’t have any, therefore I could not override it). Would it be possible to add the avrdude.conf in nix-shell using environment.etc, or is it something, that can be done only in configuration.nix?