A lot of projects haven’t supported using $SNAP_REAL_HOME instead for real home directory. It can be annoying if some snap packages rely on such kind of project as a dependency while the upstream maintainer is reluctant in supporting such kind of feature (e.g. https://github.com/kubernetes-sigs/controller-runtime/pull/2266 ).
So, maybe there’s a better way to handle this issue, if a snap program tries to visit the files or dirs that doesn’t exist at the remapped snap $HOME path, we check the permission to see if this is a valid call, then modify the system call for files and dirs so that it can get redirected to the actual file under real home dir automatically. (tries to link the files and dirs under the real home dir to the snap home path)