1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

New "indexed" installable syntax: <drvPath>!<outputName>

Being conservative and only doing a single output name for now.
This commit is contained in:
John Ericson 2021-02-12 21:51:36 +00:00
parent 4bf3eb27e6
commit 8499f32fb2
5 changed files with 72 additions and 3 deletions

View file

@ -0,0 +1,17 @@
source common.sh
drv=$(nix eval -f multiple-outputs.nix --raw a.drvPath)
if nix build "$drv!not-an-output" --json; then
fail "'not-an-output' should fail to build"
fi
nix build "$drv!first" --json | jq --exit-status '
(.[0] |
(.drvPath | match(".*multiple-outputs-a.drv")) and
(.outputs |
.first and
(has("second") | not)))
'
# TODO use
# (.first | match(".*multiple-outputs-a-first")) and
# once we make it put the result paths in the buildables.