aboutsummaryrefslogtreecommitdiff
path: root/tests/functional
diff options
context:
space:
mode:
authorTom Bereknyei <tomberek@gmail.com>2023-08-19 17:03:31 -0400
committerlunaphied <lunaphied@lunaphied.me>2024-03-25 15:30:36 +0000
commit4494f9097f7959b2f7e63decf04a5bd592018836 (patch)
tree37db3dc35cb83ce9fb1f9794d63b31885a399174 /tests/functional
parentd3d7489571baeb651d3843dba3b638621694c174 (diff)
feat: notation to refer to no attribute search prefix
An attrPath prefix of "." indicates no need to try default attrPath prefixes. For example `nixpkgs#legacyPackages.x86_64-linux.ERROR` searches through ``` trying flake output attribute 'packages.x86_64-linux.legacyPackages.x86_64-linux.ERROR' using cached attrset attribute '' trying flake output attribute 'legacyPackages.x86_64-linux.legacyPackages.x86_64-linux.ERROR' using cached attrset attribute 'legacyPackages.x86_64-linux' trying flake output attribute 'legacyPackages.x86_64-linux.ERROR' using cached attrset attribute 'legacyPackages.x86_64-linux' ``` And there is no way to specify that one does not want the automatic search behavior. Now one can specify `nixpkgs#.legacyPackages.x86_64-linux.ERROR` to only refer to the rooted attribute path without any default injection of attribute search path or system. Change-Id: Iac1334e1470137b7ce11dcf845513810230638ec (cherry picked from commit d4aed18883b361133607296fb6cd789c47427a38)
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/flakes/flakes.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/functional/flakes/flakes.sh b/tests/functional/flakes/flakes.sh
index 128f759ea..7781eb51b 100644
--- a/tests/functional/flakes/flakes.sh
+++ b/tests/functional/flakes/flakes.sh
@@ -79,6 +79,10 @@ nix registry add --registry $registry nixpkgs flake1
nix registry list | grep '^global'
nix registry list | grepInverse '^user' # nothing in user registry
+# Test fuzzy and exact flake attribute syntax.
+expectStderr 1 nix eval flake1#ERROR | grepQuiet "error:.*does not provide attribute.*or 'ERROR'$"
+expectStderr 1 nix eval flake1#.ERROR | grepQuiet "error:.*does not provide attribute 'ERROR'$"
+
# Test 'nix flake metadata'.
nix flake metadata flake1
nix flake metadata flake1 | grepQuiet 'Locked URL:.*flake1.*'