Hey there, I’m fairly new to Nix(OS) and I started using it at work too (using nix on WSL). Today I wanted to compile some C code and I’ve been hit with a missing libfl. Using libfl-dev I could easily solve out the problem but I tried to do it the nix way and got pretty stuck.
By running nix-build '<nixpkgs>' -A flex you’ll get the directory of the flex package (It also creates a symlink called result for easier access)
I was able to find libfl.so inside the lib directory.
You can link the libfl library by using -lfl.
Though, I haven’t used flex yet, so if you still have issues, please provide some code.
I can confirm that nix-build '<nixpkgs>' -A flex and looking into the resulted folder /lib does provide that libfl.so. Though I don’t understand how I should use -lfl and how can I use this directly in a nix-shell.
I’m guessing after you’ve generated the .yy.cc file or something like that using the flex command, you still have to compile it using gcc or g++ passing the -lfl flag. Though, that might be optional, I don’t know.
As you have not shared what you’re trying to do exactly I can only guess.