-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Git LFS in private repositories #4623
Comments
#4635 has the potential to fix the first use case by default
Did you configure LFS globally in your git user config? |
Yes, the following section is present in
|
I marked this as stale due to inactivity. → More info |
For some projects I am working on LFS is crucial. I hope this gets solved soon. |
I marked this as stale due to inactivity. → More info |
Still relevant. |
This error also pops up when using a git repository that uses LFS as a flake input, or seemingly even just by having a flake in a repository with LFS (c.f. NixOS/nixpkgs#137998). |
but .... what if you do care about the LFS files .... 🥲 🥲 🥲 🥲 🥲 🥲 🥲 |
I think the plan for this would be
|
Gitlab forces free users now to use LFS in many cases, so I guess this will become a lot more relevant. |
AFAIU, this is unspecific to private repos:
...fails in the same way:
|
@SomeoneSerge for huggingface this worked for me: fetchgit { # from `pkgs`, not `builtins`, may not matter?
url = "https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2";
rev = "b70aa86578567ba3301b21c8a27bea4e8f6d6d61";
hash = "sha256-IAe/tHFB7yqFRF5aRojkNCD8TbKj8XQMt6eEyPmr4HU=";
fetchLFS = true;
} |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Is there currently a workaround for fetching nix flakes input with lfs? |
@bratorange I think the only way is to create a tar.gz that includes all of the LFS files |
@tengkuizdihar do you know if there is a way to directly do that through a github/gitlab link? also, I assume that does not allow things like ssh authentication in case of private repos. |
nope no idea |
If you are fetching another repo, you could use For local LFS files in flakes, the only option is for |
In Nixpkgs PRs NixOS/nixpkgs#105998 and NixOS/nixpkgs#113580, support for git LFS is added to the Nixpkgs
fetchgit
function. The problem withfetchgit
, however, is that it does not properly support private repositories. Nix'builtins.fetchGit
does support private repositories, but it does not seem to support git LFS.Currently, when trying to
builtins.fetchGit
a repository with LFS, the following happens:Ideally, it should be possible to
builtins.fetchGit
the repo either with or without downloading the LFS files. In one use case, the LFS files are used for non-vital things, like tests or documentation. The nix derivations do not depend on those files. Not downloading the LFS files would save space. In another use case, the LFS files are needed to build the derivations, and should therefore be downloaded.It is possible to
export GIT_LFS_SKIP_SMUDGE=1
to accomplish the first use case (i.e. fetch private LFS repository without actually downloading the LFS files), but it would be be much nicer to have it as an option of thebuiltins.fetchGit
function.The text was updated successfully, but these errors were encountered: