Hacker News new | ask | show | jobs
by Siyo 11 days ago
I wonder if something equivalent exists for loading other kinds of assets. Take files that would normally live under `/usr/share`. References to these files are typically hardcoded with an absolute path as well. It's usually possible to relocate them at build time by specifying a different absolute prefix, but making them relative the conventional way would likely require patching.
1 comments

You can always set "RESOURCE_PATH" and load your files from there.
Sure, assuming this is your own software. The context of the article is on working towards a general approach to relocatable nix binaries so I don't think that's going to scale across nixpkgs.
If you don't own the software, the software can do many things to break nix' relocatable binaries too.