Skip to content

NPV 107

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

NPV-107: Override has empty second argument

Description

When a pkgs/by-name package is overridden in all-packages.nix with callPackage ./path { } (an empty second argument), the override is redundant. The auto-calling mechanism already provides exactly this definition.

Error message

Because {relative_package_dir} exists, the attribute `pkgs.{package_name}` must be defined like

    {package_name} = callPackage {expected_path_expr} { /* ... */ };

  However, in this PR, the second argument is empty. See the definition in {file}:{line}:

{definition}

  Such a definition is provided automatically and therefore not necessary. Please remove it.

Example

Given pkgs/by-name/no/nonDerivation/package.nix exists, and pkgs/top-level/all-packages.nix contains:

self: super: { nonDerivation = self.callPackage ./../by-name/no/nonDerivation/package.nix { }; }

The error is:

Because pkgs/by-name/no/nonDerivation exists, the attribute `pkgs.nonDerivation` must be defined like

    nonDerivation = callPackage ./../by-name/no/nonDerivation/package.nix { /* ... */ };

  However, in this PR, the second argument is empty. See the definition in pkgs/top-level/all-packages.nix:1:

    nonDerivation = self.callPackage ./../by-name/no/nonDerivation/package.nix { };

  Such a definition is provided automatically and therefore not necessary. Please remove it.

How to fix

Remove the manual definition from all-packages.nix. Since the second argument is empty ({ }), the auto-call mechanism will provide the exact same definition.

Clone this wiki locally