tests/fetch-tests: avoid unnecessary copy-to-store

Previously path was concatenated using string interpolation. This commit
switches from string interpolation to path interpolation.

The problem is nix will copy the "${directory}" to a new store
object, meaning anything outside its root won't be available.

From the nix manual:

> A path in an interpolated expression is first copied into the Nix
> store, and the resulting string is the store path of the newly created
> store object.

https://nix.dev/manual/nix/2.28/language/string-interpolation#interpolated-expression
This commit is contained in:
Stanislav Asunkin 2025-05-10 22:07:02 +03:00 committed by Matt Sturgeon
parent 8dbd015500
commit ddddd780e0
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -32,7 +32,7 @@ let
handleEntry = handleEntry =
name: type: name: type:
let let
file = "${path}/${name}"; file = /${path}/${name};
in in
if type == "regular" then if type == "regular" then
lib.optional (lib.hasSuffix ".nix" name) ( lib.optional (lib.hasSuffix ".nix" name) (