nix-community/nix-ld-rs

32-bit nix ld

Closed this issue · 3 comments

Hi,

I think nix-ld is very useful, and wanted to run some 32-bit programs recently. What I have done is patch nix-ld-rs (and probably nix-ld but I haven't tried that) to rename NIX_LD* to NIX_LD32* which has changed from /run/current-system/sw/share/nix-ld to /run/current-system/sw/share/nix-ld32 and contains the pkgsi686Linux versions of the packages. Then made a NixOS module to use this, copied from the original one with relevant bits made 32-bit.

KoviRobi/nixos-config@4c0826f

It works for me, I suppose I'm asking/proposing it might be worth making this less of a hack? Perhaps add a feature flag for 32-bit (and I imagine to the C++ nix-ld), then update the package in NixOS and modify the module to support both?

Any suggestions are appreciated, if it looks fine then I'll try to get around to implementing it (though these days I am terrible with finishing things, sorry)

You can set NIX_LD_i686_linux or similar for other systems (run nix-ld directly and it will print out the name).

Let's close this issue since the requested feature is already implemented on the nix-ld-rs end, but refactoring the upstream NixOS module would be a useful addition. I have a similar adhoc setup but something more structured would be cool.

If you do go down this route, please update this thread with your nixpkgs PR!

Yes good idea, I have opened NixOS/nixpkgs#326948