Create versioned binary/symlink

Hi all, I’m trying to create a nix shell with Lua installed. The problem is the official distribution only produces non-versioned binary (i.e. lua), while I want to have versioned binaries (lua5.2, etc.).

I was able to create a lua5.2 shell alias for lua, but this doesn’t work for commands that drop into subshells such as those invoked from Makefile.

I wonder what are other ways to do this?

Thanks a lot!

You can define your own derivation, maybe with runCommand, that creates symlinks with the desired name in its own $out, and then depend on your derivation instead of directly on Lua.

1 Like