automate dependencies installation on Rstudio Server

Take a look at my old post What are the main limits to R in a production environment? on why we use the Nix functional package manager. As soon as your dependencies go beyond other R packages (system libraries, newer c++ compiler, java/scala/spark packages, python packages...) - which is very often - R package management cannot help. Nix also allows non-admin users to install all those external dependencies themselves without affecting anybody else. It is a solved problem but I keep seeing the wheel reinvented (conda's LD_LIBRARY_PATH mess, etc...).