12 lines
802 B
Plaintext
12 lines
802 B
Plaintext
run git submodule foreach --quiet 'echo ":|> ^ nix-prefetch-git $name^ nix-prefetch-git --quiet --fetch-submodules --url $toplevel/$sm_path --rev $sha1 > %o |> $displaypath.json $(TUP_CWD)/<submodules> {prefetch}"'
|
|
# Generate a JSON description for each Git submodule that
|
|
# can be used to generate a Nix fixed-output derivation.
|
|
|
|
: {prefetch} |> ^ Generate %o^ \
|
|
echo '# DO NOT EDIT #' >> %o; \
|
|
echo 'let readJSON = p: with builtins; fromJSON (readFile p); in [' >> %o; \
|
|
git submodule foreach --quiet 'echo "{ name = \"$name\"; value = { smPath = \"$sm_path\"; prefetch = readJSON ./$displaypath.json; url = \"`git remote get-url origin`\"; }; }"' >> %o; \
|
|
echo ']' >> %o; \
|
|
|> submodules.nix $(TUP_CWD)/<submodules>
|
|
# Generate a Nix expression that contains a description of all submodules.
|