summary refs log tree commit diff
path: root/pkgs/build-support/fetchgit/default.nix
diff options
context:
space:
mode:
authorJonathan Ringer <jonringer117@gmail.com>2020-12-04 23:32:48 -0800
committerJonathan Ringer <jonringer@users.noreply.github.com>2021-01-11 09:41:06 -0800
commit741285611f08230f44b443f0b2788dd93c4ba8d0 (patch)
treee208cefdabd4d67baeaa307817a159e58abec0ec /pkgs/build-support/fetchgit/default.nix
parentecf84de70c91cbb1b540f58391ffb95f4fe53445 (diff)
downloadnixpkgs-741285611f08230f44b443f0b2788dd93c4ba8d0.tar
nixpkgs-741285611f08230f44b443f0b2788dd93c4ba8d0.tar.gz
nixpkgs-741285611f08230f44b443f0b2788dd93c4ba8d0.tar.bz2
nixpkgs-741285611f08230f44b443f0b2788dd93c4ba8d0.tar.lz
nixpkgs-741285611f08230f44b443f0b2788dd93c4ba8d0.tar.xz
nixpkgs-741285611f08230f44b443f0b2788dd93c4ba8d0.tar.zst
nixpkgs-741285611f08230f44b443f0b2788dd93c4ba8d0.zip
fetchgit: add lfs support
Diffstat (limited to 'pkgs/build-support/fetchgit/default.nix')
-rw-r--r--pkgs/build-support/fetchgit/default.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix
index 0405951a9e4..5f5ded128de 100644
--- a/pkgs/build-support/fetchgit/default.nix
+++ b/pkgs/build-support/fetchgit/default.nix
@@ -1,4 +1,4 @@
-{stdenvNoCC, git, cacert}: let
+{stdenvNoCC, git, git-lfs, cacert}: let
   urlToName = url: rev: let
     inherit (stdenvNoCC.lib) removeSuffix splitString last;
     base = last (splitString ":" (baseNameOf (removeSuffix "/" url)));
@@ -20,6 +20,7 @@ in
   # successfully. This can do things like check or transform the file.
   postFetch ? ""
 , preferLocalBuild ? true
+, fetchLFS ? false
 }:
 
 /* NOTE:
@@ -53,13 +54,15 @@ stdenvNoCC.mkDerivation {
   inherit name;
   builder = ./builder.sh;
   fetcher = ./nix-prefetch-git;  # This must be a string to ensure it's called with bash.
-  nativeBuildInputs = [git];
+
+  nativeBuildInputs = [ git ]
+    ++ stdenvNoCC.lib.optionals fetchLFS [ git-lfs ];
 
   outputHashAlgo = "sha256";
   outputHashMode = "recursive";
   outputHash = sha256;
 
-  inherit url rev leaveDotGit fetchSubmodules deepClone branchName postFetch;
+  inherit url rev leaveDotGit fetchLFS fetchSubmodules deepClone branchName postFetch;
 
   GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";