Skip to content

Deprecate use of stdenv.lib across Nixpkgs #108938

@siraben

Description

@siraben

Carry over discussion from IRC #nixos-dev and #108934. Inspired by the doc change in c06b2b3 recommending top-level usage of lib over stdenv.lib, we want to reduce confusion for newcomers and unnecessary complexity by making lib the canonical way to access the Nix library. We may still want to keep stdenv.lib to not break external code, and place a trace or similar at its definition site.

$ nix-shell -p ag --run 'ag "stdenv\.lib" -l | wc -l'
11783

There are over 11000 files where stdenv.lib occurs at least once. Beyond splitting this change across multiple PRs, in what ways can the change be automated?

Pinging @alyssais @Profpatsch @FRidh @Atemu @ehmry

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.skill: sprintableA larger issue which is split into distinct actionable tasks6.topic: best practicesDocumentation and discussion around best practices for Nixpkgs development

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions