Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document several undocumented builtin functions #8491

Merged
merged 2 commits into from Jun 14, 2023

Conversation

wentasah
Copy link
Contributor

Motivation

I've found that builtins.fromTOML is not documented in the Nix manual. This PR adds the documentation of this function as well as of few others.

Context

fetchTree documentation took into account comments in #6740.

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • documentation in the internal API docs
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or incompatible change: updated release notes

Priorities

Add 馃憤 to pull requests you find important.

This will allow documenting them (in later commits).

Note that we keep the old constructor even if it is no longer used by
Nix code, because it is used in tests/plugins/plugintest.cc, which
suggests that it might be used by some external plugin.
@wentasah wentasah requested a review from edolstra as a code owner June 11, 2023 20:40
@wentasah wentasah changed the title Builtins doc Document several undocumented builtin functions Jun 11, 2023
@wentasah
Copy link
Contributor Author

I've applied the suggestions. I'll try to reformulate fetchTree doc later today. The current (and incorrect) text is based on comments in #6740.

I tried to figure out what is a immutable flake ref, but a quick look into the manual and source code does not show anything. I guess that it might be either a reference to a git repo locked in flake.lock or a reference to a specific git commit. Is that correct? Any other hints?

@fricklerhandwerk
Copy link
Contributor

I suggest splitting things out into separate PRs where you expect they'd need more work, simply to avoid blocking things on each other. I've seen 3 sentence PRs being open for months because they require figuring out non-trivial things, which in combination with intermittent availability of PR authors and maintainers leads to long waiting times.

@wentasah
Copy link
Contributor Author

Good point. I've removed the fetchTree commit from this PR and will submit it later in #8509.

src/libexpr/primops/context.cc Outdated Show resolved Hide resolved
src/libexpr/primops/context.cc Outdated Show resolved Hide resolved
src/libexpr/primops/context.cc Show resolved Hide resolved
Until now, these functions were completely missing in the Nix manual.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
@wentasah
Copy link
Contributor Author

Thank you @fricklerhandwerk. This is definitely much better than how I would be able to formulate it. I've added you to the Co-authored-by tag.

@Ericson2314 Ericson2314 merged commit e377746 into NixOS:master Jun 14, 2023
8 checks passed
@Ericson2314
Copy link
Member

Thanks everyone, this is very nicely done!

@fricklerhandwerk fricklerhandwerk added documentation language The Nix expression language; parser, interpreter, primops, evaluation, etc labels Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation language The Nix expression language; parser, interpreter, primops, evaluation, etc
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants