Skip to content

Commit

Permalink
rustPlatform.importCargoLock: add fetchSubmodules option
Browse files Browse the repository at this point in the history
  • Loading branch information
yu-re-ka committed Mar 18, 2023
1 parent 25f6206 commit 9212b72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/build-support/rust/import-cargo-lock.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# Allow `builtins.fetchGit` to be used to not require hashes for git dependencies
, allowBuiltinFetchGit ? false

, fetchSubmodules ? false

# Hashes for git dependencies.
, outputHashes ? {}
} @ args:
Expand Down Expand Up @@ -127,12 +129,14 @@ let
inherit (gitParts) url;
rev = gitParts.sha; # The commit SHA is always available.
sha256 = gitShaOutputHash.${gitParts.sha};
inherit fetchSubmodules;
}
else if allowBuiltinFetchGit then
builtins.fetchGit {
inherit (gitParts) url;
rev = gitParts.sha;
allRefs = true;
submodules = fetchSubmodules;
}
else
missingHash;
Expand Down

0 comments on commit 9212b72

Please sign in to comment.