BuildFHSEnv for programs that are self updating


I’m curious to know, how is it possible to package complicated binaries softwares that have auto-updates procedure/plugin installations, and that use different paths, like /opt or /usr/bin to install themself and the dependencies ? I guess that BuildFHSEnv produces a write only path, so it will have troubles during installation of plugins right ?

Is there a writable equivalent of buildFHSenv (it could be possible to configure a folder outside the nix store to store the system) ? And what is the trick used by steam for example ?