Skip to content

Commit

Permalink
callPackage: Add comment about callPackage/mkPackage usage
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Jan 15, 2025
1 parent a2c1e46 commit b88cfe5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/customisation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ rec {
if missingArgs == { } then
if fargs?mkPackage then
if fargs != { mkPackage = false; } then
# If your file is e.g. an attrset with a package and something else,
# use `{ callPackage }: { foo = callPackage ({ mkPackage}: ...); ... }`
# Explaining that in the error message would be too verbose and confusing.
# TODO: link to docs
throw ''
callPackage: A package function that uses `mkPackage` must only have `{ mkPackage }:` as its arguments.
Any other dependencies should be taken from the `mkPackage` callback.
Expand Down

0 comments on commit b88cfe5

Please sign in to comment.