No such file or directory on executable

Hello all, sorry if this seems obvious, I’ve just started using NixOS.

I configured my Emacs to run Twelf (, to do so I’ve configured direnv, so that whenever I enter in the folder where I have Twelf files I get twelf-server, which is needed to develop, and this works great (from the CLI).

I also downloaded Twelf (Download - The Twelf Project) because I need some Elisp to make the whole configuration run correctly.
When I launch Emacs I need to specify where twelf-server is, but I get a file not found error if I specify the path at which I’ve downloaded the server, of course specifying the output of whereis twelf-server the configuration process correctly finishes.
Also, if I cd into the folder at which I’ve downloaded the server and try to ./twelf-server I get the same file not found error.
Why is this? My setup is working if I specify the nix store path everytime but I am missing a crucial part of how NixOS is working, could you please point me to the relevant docs?

Thanks for any help.

There Is a twelf package on nixpkgs it includes the twelf server , I’m guessing the reason.ehy manually downloaded Version doesn’t work is cause the linking to the libraries it uses does not conform nixos paths, and needs to be patched (nix-ld may help without patching)

But using the version from nixpkgs should work without you having to do as much , using the version from nixpkgs and emacs + direnv + nix file to set it up,should work fine, with specifying “twelf-server” as path

Thanks for you reply.

I’ve installed twelf from nixpkgs and works great, the “problem” is that everytime I need to refer to the nix store path.
I did not understand the last part of your answer: what do you mean with “specifying “twelf-server” as path”?

u shouldnt have to refer to the whole nix store path, emacs with the direnv plugin and a direnv file with use_nix should be able to start twelf-server with twelf-server instead of /nix/store.../bin/twelf-server GitHub - wbolster/emacs-direnv: direnv integration for emacs when the folder has a shell/default.nix

{ pkgs ? import <nixpkgs> {}}:

pkgs.mkShell {
  packages = [ pkgs.twelf];
} maybe that provides some reference points too

i am trying to setup twelf as well, can you tell me how you configured your twelf with emacs in nixos ?

File mode specification error: (invalid-function '(Reconstruction (,(toggle trace '(twelf-recon-trace) '(string-equal twelf-recon-trace true))) [traceMode (twelf-set-parm Recon.traceMode) t]))

i am getting this error when running twelf on emacs any help


I am going through this same error, have you been able to fix it? I get this:
Invalid function: `(“Reconstruction” (,(toggle “trace” '(twelf-toggle-recon-trace) '(string-equal twelf-recon-trace “true”))) [“traceMode” (twelf-set-parm “Recon.traceMode”) t])

Whenever I try to run “twelf-server”

Were you able to figure it out.