Skip to content

NPV 100

Philip Taron edited this page Feb 16, 2026 · 1 revision

NPV-100: By-name attribute is undefined

Description

Every package directory under pkgs/by-name should automatically define a corresponding top-level attribute in pkgs. If the attribute is missing, something has gone wrong with the auto-calling mechanism.

Error message

pkgs.{attribute_name}: This attribute is not defined but it should be defined automatically as {relative_package_file}

Example

Given pkgs/by-name/fo/foo/package.nix:

{ someDrv }: someDrv

If pkgs.foo is not present in the evaluated package set, the error is:

pkgs.foo: This attribute is not defined but it should be defined automatically as pkgs/by-name/fo/foo/package.nix

How to fix

Ensure the package.nix file evaluates correctly and returns a derivation. The attribute should be automatically provided by the pkgs/by-name infrastructure. If you are overriding the attribute in all-packages.nix, make sure the override is correct.

Clone this wiki locally