Skip to content

Commit

Permalink
pkgs/by-name: document toplevel argument restrictions
Browse files Browse the repository at this point in the history
We've been bitten by this at least twice, let's make sure to write it
down.
  • Loading branch information
flokli committed Jul 7, 2024
1 parent 7931673 commit 7d3eb17
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkgs/by-name/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ and override its value in [`pkgs/top-level/all-packages.nix`](../top-level/all-p
}
```

### Toplevel argument restrictions
The list of toplevel arguments should be restricted to packages defined in the
common nixpkgs package set, and simple `enable*` boolean flags.

As the expression is being `callPackage`'ed, both newly-defined packages, as
well as those added through the use of overlays will cause defaults to be
overwritten in a unexpected and hard-to-debug fashion.

In case you're intending to write more flexible package expressions, consider
defining them outside `by-name`.

## Manual migration guidelines

Most packages are still defined in `all-packages.nix` and the [category hierarchy](../README.md#category-hierarchy).
Expand Down

0 comments on commit 7d3eb17

Please sign in to comment.