Customizing system-wide configuration files in packages

Since I need a docker image using non-NixOS as base I am going with R_PROFILE approach. Still this is very specific to one file for one application. Is there an approach that could be used for any application that needs global configuration files? Btw I am now having much more serious issues with R from nixpkgs (Improving NixOS data science infrastructure: CI for MKL&CUDA - #50 by alexv).