• Past Pollution
    link
    English
    81 year ago

    Not exactly. If one package needs foo as a dependency, and another package also needs foo, it won’t download a second copy.

    But if another package needs, say, an older version of foo, it can download the older version of foo and you’ll have two foo packages.

    This is possible because Nix packages have hashes to differentiate between them, so any package can ask for the exact version of foo it needs instead of asking for foo in general and hoping the version it gets isn’t incompatible.

    Pretty sure this is also different from other containerized package managers, like Flatpaks or Snaps, which I believe throw all the dependencies in with their packages so each package has exactly what it needs in its container, and which is obviously going to be much more bloated than having shared dependencies. As far as I know Nix on the other hand doesn’t get any more bloated than other distros (keep in mind that regular distros like Arch will still sometimes have multiple versions of a package, for example Python).