From b60d3f6270168bd3560637931a9c42eb320d760b Mon Sep 17 00:00:00 2001 From: sohalt Date: Fri, 13 Oct 2023 20:33:18 +0200 Subject: [PATCH] fetchgithub: support fetchLFS --- pkgs/build-support/fetchgithub/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/fetchgithub/default.nix b/pkgs/build-support/fetchgithub/default.nix index 4ce3c6e84d76..d27a3df7d3df 100644 --- a/pkgs/build-support/fetchgithub/default.nix +++ b/pkgs/build-support/fetchgithub/default.nix @@ -4,6 +4,7 @@ lib.makeOverridable ( { owner, repo, rev, name ? "source" , fetchSubmodules ? false, leaveDotGit ? null , deepClone ? false, private ? false, forceFetchGit ? false +, fetchLFS ? false , sparseCheckout ? [] , githubBase ? "github.com", varPrefix ? null , meta ? { } @@ -25,7 +26,7 @@ let }; passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "forceFetchGit" "private" "githubBase" "varPrefix" ]; varBase = "NIX${lib.optionalString (varPrefix != null) "_${varPrefix}"}_GITHUB_PRIVATE_"; - useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit || (sparseCheckout != []); + useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone || forceFetchGit || fetchLFS || (sparseCheckout != []); # We prefer fetchzip in cases we don't need submodules as the hash # is more stable in that case. fetcher = @@ -52,7 +53,7 @@ let fetcherArgs = (if useFetchGit then { - inherit rev deepClone fetchSubmodules sparseCheckout; url = gitRepoUrl; + inherit rev deepClone fetchSubmodules sparseCheckout fetchLFS; url = gitRepoUrl; } // lib.optionalAttrs (leaveDotGit != null) { inherit leaveDotGit; } else { url = "${baseUrl}/archive/${rev}.tar.gz";