Skip to content

Recommend pkgs.newScope over lib.callPackageWith #1183

@eclairevoyant

Description

@eclairevoyant

Observations
lib.callPackageWith doesn't bring pkgs.xorg the way regular pkgs.callPackage does.

https://github.com/NixOS/nixpkgs/blob/42cd7da40a9c88dd0ec2ea4f2682093f54c6c41a/lib/customisation.nix#L259-L324

https://github.com/NixOS/nixpkgs/blob/42cd7da40a9c88dd0ec2ea4f2682093f54c6c41a/pkgs/top-level/splice.nix#L142-L160

Since pkgs.callPackage is just pkgs.newScope { }:

https://github.com/NixOS/nixpkgs/blob/42cd7da40a9c88dd0ec2ea4f2682093f54c6c41a/pkgs/top-level/splice.nix#L170

we should be recommending pkgs.newScope as a less unwieldy method that properly preserves the pkgs.callPackage behavior.

Problem

Approaches

Willing to help?

Priorities

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    siteImprovements to the site infrastructure or content presentation
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions