Skip to content

Documentation: guide for using let in vs rec vs finalAttrs #315337

@isabelroses

Description

@isabelroses

Problem

I often see maintainers and committers alike suggesting to use the let in syntax following the practices suggested by https://nix.dev/guides/best-practices.html. However, this is hardly uniform some would suggest using rec, and it's hard to get a solid grasp on what to use in each situation. This was only exemplified when finalAttrs started popping up more commonly as of recent.

Proposal

From my understanding https://nix.dev is an official source so perhaps it would be best to get everyone on board and aware of this best practice? Or maybe to get a more concrete set of best practices to use in each given situation. Or at the very least make members aware that the let in syntax is said to be the best practice, as stated in https://nix.dev/guides/best-practices.html.

Checklist


Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    6.topic: best practicesDocumentation and discussion around best practices for Nixpkgs development9.needs: community feedbackThis needs feedback from more community members.9.needs: documentationThis needs to be documented well.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions