flokli / nix-casync

A more efficient way to store and substitute Nix store paths
80 stars 4 forks source link

pkg/server: support serving compressed NAR files #25

Closed flokli closed 2 years ago

flokli commented 2 years ago

With the --nar-compression flag, people can modify the compression algorithm that's used to transfer .nar files.

The .narinfo files will contain a Compression field set to the compression specified via that flag.

Luckily, Nix doesn't really care about the FileSize and FileHash parameters when downloading - it only validates the decompressed .nar file.

The HTTP handlers are able to serve any of the supported compression algorithms.

Note only a subset of (fast) compression algorithms is supported, as this is really only used as a poorman's alternative to Content-Encoding.