Commit graph

9 commits

Author SHA1 Message Date
Robert Hensing
cbce27eb64 feat: Support Store::open from environment, not just auto
Note that `"auto"` holds a strange middle ground, reading
part of the general environment, but not all of it. It
ignores `NIX_REMOTE` and the `store` option.

(cherry picked from commit 7ba92a3793c2fe11938e802e6b61edee042b193a)
2025-10-04 02:31:16 +02:00
Robert Hensing
c986c09b8c feat: Store.parse_store_path()
(cherry picked from commit 6b92d4164b94d5030929dfb56577b1fd8d62e067)
2025-10-04 02:31:16 +02:00
Robert Hensing
3d3c77eced doc: StorePath.name()
(cherry picked from commit 2f3dc27eb816634ebb8edbabd409ebc52db9a0bb)
2025-10-04 02:31:16 +02:00
Robert Hensing
ce07ed1c07 fix: Mark all StorePath pointer management as unsafe
... because it is. I had previously dismissed the comparatively
trivial unsafety of these functions, assuming the caller is
aware of the purpose of them and reasonably familiar with manual
memory management.
That would have been fine in an unsafe by default language like C++,
which Rust is not.

(cherry picked from commit b43455fdd0468f067741a79a7031ba2fa907f0eb)
2025-10-04 02:31:16 +02:00
Robert Hensing
6193575d1e fix: Require non-null pointer in StorePath
Fixes https://github.com/nixops4/nixops4/issues/65,
possible undefined behavior.

This doesn't make the code nice wrt *const/*mut distinction, but
since we're not mutating it, this should be fine.

(cherry picked from commit 75d448aad923a5f835f0562400e223df43103ea4)
2025-10-04 02:31:16 +02:00
Robert Hensing
37da6411d0 maint: Use /// for doc comments
(cherry picked from commit 4a390197f71653dda99696ed5c9cbca8c6a95a4b)
2025-10-04 02:31:16 +02:00
Robert Hensing
4688ccbf95 refact: Make the callback convert to Result<String> immediately
This is slightly easier to use than the previous pattern that was
always followed up by the same conversions.

(cherry picked from commit 756c080730cd4fa81d4c0e3a99688cbe8debe57f)
2025-10-04 02:30:46 +02:00
Robert Hensing
9a6ef0489e doc: Clarify ownership around StorePath::new_*
(cherry picked from commit 397f00e8eefff376759f05bd0cbaecc106c681df)
2025-10-04 02:30:46 +02:00
Robert Hensing
87203ef394 feat: EvalState.realise_string
(cherry picked from commit f2b1142018fd64dd45ec97f1eccf0c48cc4a8c6d)
2025-10-04 02:30:46 +02:00