File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -76,3 +76,21 @@ git -C "$rootRepo" commit -m "Add flake.nix"
76
76
77
77
storePath=$( nix flake metadata --json " $rootRepo ?submodules=1" | jq -r .path)
78
78
[[ -e " $storePath /submodule" ]]
79
+
80
+ # The root repo may use the submodule repo as an input
81
+ # through the relative path. This may change in the future;
82
+ # see: https://discourse.nixos.org/t/57783 and #9708.
83
+ cat > " $rootRepo " /flake.nix << EOF
84
+ {
85
+ inputs.subRepo.url = "git+file:./submodule";
86
+ outputs = { ... }: { };
87
+ }
88
+ EOF
89
+ git -C " $rootRepo " add flake.nix
90
+ git -C " $rootRepo " commit -m " Add subRepo input"
91
+ (
92
+ cd " $rootRepo "
93
+ # The submodule must be locked to the relative path,
94
+ # _not_ the absolute path:
95
+ [[ $( nix flake metadata --json | jq -r .locks.nodes.subRepo.locked.url) = " file:./submodule" ]]
96
+ )
You can’t perform that action at this time.
0 commit comments