File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 149149
150150 subdir = if key == lockFile . root then "" else node . locked . dir or "" ;
151151
152- flake = import ( sourceInfo + ( if subdir != "" then "/" else "" ) + subdir + "/flake.nix" ) ;
152+ outPath = sourceInfo + ( ( if subdir == "" then "" else "/" ) + subdir ) ;
153+
154+ flake = import ( outPath + "/flake.nix" ) ;
153155
154156 inputs = builtins . mapAttrs
155157 ( inputName : inputSpec : allNodes . ${ resolveInput inputSpec } )
176178
177179 outputs = flake . outputs ( inputs // { self = result ; } ) ;
178180
179- result = outputs // sourceInfo // { inherit inputs ; inherit outputs ; inherit sourceInfo ; _type = "flake" ; } ;
181+ result =
182+ outputs
183+ # We add the sourceInfo attribute for its metadata, as they are
184+ # relevant metadata for the flake. However, the outPath of the
185+ # sourceInfo does not necessarily match the outPath of the flake,
186+ # as the flake may be in a subdirectory of a source.
187+ # This is shadowed in the next //
188+ // sourceInfo
189+ // {
190+ # This shadows the sourceInfo.outPath
191+ inherit outPath ;
192+
193+ inherit inputs ; inherit outputs ; inherit sourceInfo ; _type = "flake" ;
194+ } ;
180195
181196 in
182197 if node . flake or true then
You can’t perform that action at this time.
0 commit comments