There is something similar which has been suggested or mentioned here in the forum several times.
I learned it from @SGS and liked it a lot , so I’m picking a random post from him at a quick search for “custom.cfg”:
I think the context is clear anyway.
A few words are mentioned here:
https://wiki.archlinux.org/title/GRUB#Generate_the_main_configuration_file
Note e.g.
Changes to
/boot/grub/custom.cfg
do not require re-running grub-mkconfig, since/etc/grub.d/41_custom
adds the necessarysource
statement to the generated configuration file.
Which is quite useful in my opinion.