I want get back into Nim and pick up an old project I had developed 18 months ago. I'd like to use nimlsp now, but I develop on an air-gapped network (no Internet access).
How can I install a package (like nimlsp) via nimble without internet access?
Have a look at this: https://github.com/nim-lang/nimble#local-package-development
Basically, clone the package (and the dependencies), move them to a usb stick to get it on the air-gapped system, then run nimble install in the folders. You'll probably need to start from the lowest dependency in the tree and work your way up tho.
You could also create a local package list on the air gapped pc, download the packages you like and change their url in your package list to the folder they are in (assuming nimble accepts filesystem paths) https://github.com/nim-lang/nimble#configuration This way, nimble should resolve the dependencies and install everything for you, and although you'll still have some work generating the packages.json file, you won't have to redo it next time.
Unfortunately Nimble does not have a concept of "tarball" packages like most languages, making it difficult to distribute or preserve the package ecosystem.
You might be interested in https://github.com/nim-lang/packages/issues/777
Thanks for the info. I guess that's what I'll do: I'll copy all the packages from a connected machine to the air-gapped one and then install the stuff there.
But this brings me to an idea: Could I just do a nimble install <packages> on a connected machine and then copy everything (with caches and else) to the air-gapped machine?