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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make flake metadata evaluation behaviour more discoverable #6592

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ckiee
Copy link
Member

@ckiee ckiee commented May 30, 2022

See commit messages. Builds and works for me in a nix develop shell.

This helps NixOS#4945, but I haven't checked all cases are covered by this
single error message.
@ckiee
Copy link
Member Author

ckiee commented May 30, 2022

cc #4945

@tomberek
Copy link
Contributor

tomberek commented Jun 4, 2022

These commits seem to imply the entire flake.nix cannot perform evaluation. Closer would be to say that a flake.nix contains up to three attributes at the top-level: inputs, nixConfig, and outputs. Where inputs and nixConfig must be simple key-value attrsets with no function evaluation. Outputs must be a function definition for which the function body can perform any pure Nix evaluation (modulo the usage of --impure,--restrict-eval, etc).

Copy link
Member

@thufschmitt thufschmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's a great addition :)

I'm a bit annoyed by the pointer to a github issue, though. If there's some valuable information in the issue that's missing from the manual, then it should be ported to the manual rather than linked from the source code

@ckiee
Copy link
Member Author

ckiee commented Jun 8, 2022

I'm a bit annoyed by the pointer to a github issue, though. If there's some valuable information in the issue that's missing from the manual, then it should be ported to the manual rather than linked from the source code

That would be nice and it did annoy me a bit too but I'm not sure how to do that. flake.md is a manual page, not a reference guide or something else. It seems weird to include a ## Flake metadata evaluation or whatnot in what seems like more of a casual introduction. ("As an example, [...]")

If you have any ideas on how to make that fit in that'd be nice.

@edolstra
Copy link
Member

edolstra commented Jun 8, 2022

We definitely shouldn't link to GitHub issues in error messages, except maybe if there is an actual bug, which is not the case here.

src/nix/flake.md Outdated Show resolved Hide resolved
@ckiee
Copy link
Member Author

ckiee commented Jun 8, 2022

We definitely shouldn't link to GitHub issues in error messages, except maybe if there is an actual bug, which is not the case here.

Are you sure?

@stale stale bot added the stale label Jan 7, 2023
@stale stale bot removed the stale label Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants