How can a js library be imported when using guix shell?

I found a library that I want to use, js-highlight, (available in guix ) but I don’t know how can I easily import it. The minified file is in the following directory:

/gnu/store/gg0g6rdqgvmvksrjf5zb7zhdspghlg24-js-highlight-9.12.0/share/javascript/

I’m using guix shell --search-paths and envrc to create a development environment.
I tried searching in ~/guix-profile and also in ~/.config/guix/current but I’m unable to find the same share/javascript directory.

I just learn about the guix locate command:

$(guix locate highlight.min.js | awk '{print $2}')

Now I could copy the file but it kind of defeat the purpose of the package manager.

Did you specify js-highlight in a manifest.scm or guix.scm file in your projects top level dir?

Yes, this is what I want to do ( I recently discovered that there are js libraries in guix). What I have been doing is installing node (using guix), then yarn and then using yarn to install js libraries.

For a small project it would be great to package the libraries using guix. I just haven’t figure it out how to import them.

It turns out that the variable GUIX_ENVIRONMENT has access to the share/javascript directory. This variable only exists when using the regular guix shell command and not guix shell --search-paths , for this reason I could not find it earlier. So I’m just going to symlink the javascript directory, seems like a good solution.

Random test reply from within emacs. My apologies to the OP.

1 Like