lib.path.hasStorePathPrefix: init#273883
Conversation
a1ad0c1 to
48b1b5d
Compare
lib/path/default.nix
Outdated
There was a problem hiding this comment.
Reorder these to convey the most important information fastest.
/nix/store/nvl9ic0pj1fpyln3zaqrf4cclbqdfn1j-foo/bar/baz/nix/store/nix/store/nvl9ic0pj1fpyln3zaqrf4cclbqdfn1j-foo- the other things that aren't store paths.
- the derivation (I think virtually everyone would guess that one right)
There was a problem hiding this comment.
I was actually not sure about derivations myself, because you can't actually get path values to derivations legitimately, and Nix even has a check preventing derivation names ending with .drv (unless RFC 92 stuff).
But, after thinking about it, just sticking to the reference docs on store paths (lovely to have that!) should be best. There, store derivations are clearly indicated as also having a store path.
I reordered these sections as you suggested now :)
There was a problem hiding this comment.
There's drvPath on all packages, but the semantics are odd.
There's little reason to reference derivation paths as strings, let alone path values, so this is more than good enough.
Co-authored-by: Robert Hensing <[email protected]>
c21cc20 to
d4b7b15
Compare
roberth
left a comment
There was a problem hiding this comment.
Great! Let's merge when green.
|
Successfully created backport PR for |
|
Now #273884 is ready :) |
fricklerhandwerk
left a comment
There was a problem hiding this comment.
I'm a bit confused why this has such a bulky name and was not called isStorePath
|
@fricklerhandwerk Because this is technically not a store path: |
|
Okay, I see that now. Thanks. |
Description of changes
In order to implement #269283 I need a path function to detect whether a path is a store path or not. So this PR adds a function to do that:
This is followed up by a PR to split the store path from such a path: #273884
This work is sponsored by Antithesis ✨
Things done
Add a 👍 reaction to pull requests you find important.