I keep running into too many cases where binaries just don’t work. It quite a limitation. Although what Nix already does is really neat, it can be quite a hinderance for someone who wants to try a new OS and get to work.
Even after learning Nix, it’s a hassle to have to work around non-patched binaries, especially coming from workflows involving other package managers.
So this got me thinking: is it possible to make any binary magically work in NixOS? Some mechanism by which they can automatically be patched after being loaded into memory but before being executed?
What about some sort of kernel module or init system plugin that can attempt to do this, on the fly, whenever someone runs an executable? It’d be sort of like
autoPatchelfHook, but at a low level that can patch binaries when you run them.
Imagine, you download a binary anywhere, then you run it, and it just works.
Do you think this is possible?