Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Avoiding duplication of dependencies in packages

Silvan Mosberger edited this page Nov 11, 2022 · 1 revision

For now just some history:

Quoting @edolstra from 2009:

The advantages are to reduce the amount of typing needed to add a dependency (from three sites to two), and to reduce the number of trivial commits to all-packages.nix. For the former, there have been two previous attempts:

  • Use "args: with args;" in the package's function definition. This however obscures the actual expected arguments of a function, which is very bad.

  • Use "{ arg1, arg2, ... }:" in the package's function definition (i.e. use the ellipis "..." to allow arbitrary additional arguments), and then call the function with all of "pkgs" as an argument. But this inhibits error detection if you call it with an misspelled (or obsolete) argument.