How can I build a racket package "offline"?

Hi, I'm trying to build a rash with nix.
Obviously standard raco pkg install fails with http errors (this is intentional by nix).

Then I tried to link and call setup, but it failed....

Is there any standard way to achieve offline build?
I'm total newbie with raco, any help is appreciated!

Obviously standard raco pkg install fails with http errors (this is intentional by nix).

You need to change the settings of the nix sandbox.

Or install Racket with the normal installer:

I’m not sure if giving --type dir or something to raco pkg install would work in your case, but you could try.

Racket builds work perfectly well offline: the only reason raco pkg install will try to access the network is to download and install transitive dependencies.[1]

There are raco pkg subcommands that can be used for downloading package sources, but, if you are using Nix, you probably want to write Nix expressions to obtain all of the relevant sources.

Once you have the sources, you will want to use something like racket -l- pkg/dirs-catalog --immediate ./local-catalog /nix/store/x/dependency-src ...+ to make a local catalog that raco pkg install --catalog ./local-catalog can use to resolve dependencies.

If you have any further trouble, feel free to share your Nix code and specific error messages you encounter.


  1. Strictly speaking, a package could try to use the network during building, but, for example, the package-build service runs builds in a sandbox with no network, so any package with a succeeding build at https://pkgs.racket-lang.org will work. ↩︎