Bash can't find haxelib

I’m having trouble with bash not finding haxe libraries, because the libraries are hard-coded to certain folders. So I get a lot of “command not found” errors. How do I fix this, please?

cp: cannot create regular file '/usr/local/bin/lime': No such file or directory

You can use lime by using haxelib run lime. Running haxelib run lime setup is purely optional.

Instead you can alias lime="haxelib run lime" if you want that extra level of convinience.

PS: In my opinion they really should fix that issue… Creating a wrapper outside of the users home that only works within the users environment, as other users won’t probably have lime installed is a no go. They really should instead just ask for adding the above mentioned alias to .{ba,fi,z}shrc, or if it has to be a script they write, then they should put it into a user specified location instead in “root territory”…

Okay, now for the million-dollar question: Which file do aliases go in?

Depends on the shell you use and whether or not you manage its config manually or through nixos modules or home-manager.

I use bash and home-manager. And though I’m not sure I understand everything you wrote in your PS, I agree that installing outside of my home folder doesn’t make sense.

Then using programs.bash.shellAliases is probably best:

programs.bash.shellAliases = {
  lime = "haxelib run lime";

I’m not going to ask where that is; instead, I’ll ask how to bring it up in the terminal.

I do not understand the question.

I mean, is the a special command for editing that file?

Whatever editor you want to use is fine… How have you edited your home manager configuration before?

Change the setting as above and switch the configuration.

Okay, thanks. Though it seems lime is determined to look in the file system, in directories that don’t exist in nixOS.

I had a similar discussion with someone else a few days ago in the discord.

They confirmed that for them the longform (haxelib run lime) as well as the alias form worked.

So if you have an error that is not related to running the setup, please post a follow up.

This happened when I tried doing a test build.

Called from /usr/share/haxe/std/neko/Lib.hx line 42
Uncaught exception - load.c(237) : Failed to load library : /home/jorin/haxelib/lime/7,8,0//ndll/Linux64/lime.ndll ( cannot open shared object file: No such file or directory)

Well, you need to be in an environment now that provides that library.

I currently can’t remember which attribute provides it, and also I do not know if additional requirements have to be met.

It doesn’t help that I don’t even have a /usr/share folder.

I’m pretty sure that that part of the error is just hardcoded stuff from the runtime. Ignore it.

The relevant part is in the second line.

It can’t find a shared object.

What does that mean, that I need to install libc++?

You need to provide it in the environment that you use for your current project.

Usually libraries are added to the buildInputs and then the nix-shell refreshed/reloaded, though I’m not sure how to do that in your case, as I haven’t used any haxe on nixOS and I’m not sure if there is any special builder support or just a lot of manual fiddling within pure and irreproducible environments.

My own experiments with haxe are about 3 or 4 years in the past.

Thanks for your help. I checked the package just now, and libc++ isn’t in buildInputs.

You checked which package? The one you are developing? Have you added it? It is the libcxx attribute.