Skip to content

doc(lint-absolute-path-literals): edit#15887

Open
roberth wants to merge 5 commits into
NixOS:masterfrom
roberth:doc-lint-absolute-path-literals
Open

doc(lint-absolute-path-literals): edit#15887
roberth wants to merge 5 commits into
NixOS:masterfrom
roberth:doc-lint-absolute-path-literals

Conversation

@roberth
Copy link
Copy Markdown
Member

@roberth roberth commented May 19, 2026

Motivation

The previous explanation was vague and meandering.

The new text is structured around the two use cases and their disadvantages, so that it's easier to understand the context in which the arguments are made.
The subjective arguments are largely replaced by concrete ones, such as the accidental store copying risk and the difficulty of version-controlling non-hermetic expressions.

Context

@Ericson2314 and I did some explaining in NixOS Discourse
Remove All Absolute Path Literals From Nixpkgs. I don't think we would have had to explain as much with this text in place.

I wanted to make some recommendations, but "use the right type from the get go" feels like gaslighting, because Nixpkgs lib.fileset has an unresolved false positive that's blocked on e.g. an isHostRoot primop, and transitively on virtual path value stuff.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@roberth roberth requested a review from edolstra as a code owner May 19, 2026 21:43
roberth added 2 commits May 19, 2026 23:58
The previous explanation was vague and meandering.

The new text is structured around the two use cases and their
disadvantages, so that it's easier to understand the context in which
the arguments are made.
The subjective arguments are largely replaced by concrete ones,
such as the accidental store copying risk and the difficulty of
version-controlling non-hermetic expressions.
@roberth roberth force-pushed the doc-lint-absolute-path-literals branch from bf445f9 to 792bd61 Compare May 19, 2026 22:05
@nixos-discourse
Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/remove-all-absolute-path-literals-from-nixpkgs/77245/16

@Ericson2314
Copy link
Copy Markdown
Member

Thanks @roberth, I like this! I wonder if a few block-code-quote examples would help make it even clearer though?

@roberth
Copy link
Copy Markdown
Member Author

roberth commented May 20, 2026

Not sure, to be honest. The literals are pretty simple, and I don't think the two use cases really need it.
If you have something in mind, I'd be happy to review it.

Comment thread src/libexpr/include/nix/expr/eval-settings.hh Outdated
Comment thread src/libexpr/include/nix/expr/eval-settings.hh
Comment thread src/libexpr/include/nix/expr/eval-settings.hh
Comment thread src/libexpr/include/nix/expr/eval-settings.hh
@Ericson2314
Copy link
Copy Markdown
Member

These are sort of off the cuff examples. But maybe some of the tricky cases we found in Nixpkgs would be even more useful?

roberth and others added 2 commits May 20, 2026 18:27
Co-authored-by: John Ericson <git@JohnEricson.me>
Co-authored-by: John Ericson <git@JohnEricson.me>
@roberth
Copy link
Copy Markdown
Member Author

roberth commented May 20, 2026

I think it's good to keep them simple.
The lib ones were trickiest but that's less reference documentation, more "best practices" or guide material, and that's supposed to go on nix.dev.

Also we have an unsolved false positive without alternative, so we're not quite ready for this anyway.

@roberth roberth changed the title doc(lint-absolute-path-literals): rephrase entirely doc(lint-absolute-path-literals): edit May 21, 2026
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
@roberth roberth requested a review from Ericson2314 May 21, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants