File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,23 @@ cat > $flake1Dir/flake.nix <<EOF
5656 a12 = self.drvCall.outPath;
5757
5858 a13 = "\$ {self.drvCall.drvPath}\$ {self.drvCall.outPath}";
59+
60+ a14 = with import ./config.nix; let
61+ top = mkDerivation {
62+ name = "dot-installable";
63+ outputs = [ "foo" "out" ];
64+ meta.outputsToInstall = [ "out" ];
65+ buildCommand = ''
66+ mkdir \$ foo \$ out
67+ echo "foo" > \$ foo/file
68+ echo "out" > \$ out/file
69+ '';
70+ };
71+ in top // {
72+ foo = top.foo // {
73+ outputSpecified = true;
74+ };
75+ };
5976 };
6077}
6178EOF
@@ -94,3 +111,10 @@ nix build --json --out-link $TEST_ROOT/result $flake1Dir#a12
94111
95112expectStderr 1 nix build --impure --json --out-link $TEST_ROOT /result $flake1Dir #a13 \
96113 | grepQuiet " has 2 entries in its context. It should only have exactly one entry"
114+
115+ # Test accessing output in installables with `.` (foobarbaz.<output>)
116+ nix build --json --no-link $flake1Dir #a14.foo | jq --exit-status '
117+ (.[0] |
118+ (.drvPath | match(".*dot-installable.drv")) and
119+ (.outputs | keys == ["foo"]))
120+ '
You can’t perform that action at this time.
0 commit comments