logoalt Hacker News

stabblesyesterday at 9:52 PM1 replyview on HN

Does Nix do one layer per dependency? Does it run into >=128 layers issues?

In Spack [1] we do one layer per package; it's appealing, but I never checked if besides the layer limit it's actually bad for performance when doing filesystem operations.

[1] https://spack.readthedocs.io/en/latest/containers.html


Replies

hamandcheesetoday at 12:58 AM

This post has a great overview: https://grahamc.com/blog/nix-and-layered-docker-images/

tl;dr it will put one package per layer as much as possible, and compress everything else into the final layer. It uses the dependency graph to implement a reasonable heuristic for what is fine grained and what get combined.