RFD: Add lfs option to builtins.fetchGit #1208

Open
opened 2026-05-06 14:57:00 +00:00 by javalsai · 2 comments

Nix's buildins.fetchGit supports the lfs option since version 2.27. I couldn't find it in lix nor any resource proposing its implementation.

Is this addition desired? I'd like to try to contribute and would like to discuss this before putting much effort into it. I'm not very advanced in nix, but I do know intermediate nix and good C/++ though.

This would increase lix's compatibility with nix and allow the nix ecosystem to use lfs freely like in https://github.com/andir/npins/pull/231.

Nix's `buildins.fetchGit` supports the `lfs` option since version 2.27. I couldn't find it in lix nor any resource proposing its implementation. Is this addition desired? I'd like to *try* to contribute and would like to discuss this before putting much effort into it. I'm not very advanced in nix, but I do know intermediate nix and good C/++ though. This would increase lix's compatibility with nix and allow the nix ecosystem to use `lfs` freely like in https://github.com/andir/npins/pull/231.
Author

While playing with this I realized lix doesn't use its own isolated git and relies on the one present in path. That causes fetched trees to include lfs objects depending on whether the user has git-lfs installed for their user or not.

I'd suggest having lix set GIT_LFS_SKIP_SMUDGE=1 always, which should prevent git-lfs from arbitrarily stepping in. But I'm not sure how many side effects that can have, I'd argue it's still less than what arbitrary git-lfs does.

While playing with this I realized lix doesn't use its own isolated git and relies on the one present in path. That causes fetched trees to include lfs objects depending on whether the user has git-lfs installed for their user or not. I'd suggest having lix set `GIT_LFS_SKIP_SMUDGE=1` always, which should prevent git-lfs from arbitrarily stepping in. But I'm not sure how many side effects that can have, I'd argue it's still less than what arbitrary git-lfs does.
Author

In case anyone ever reads this, I got an example working with this commit. It has to be improved but works.

In case anyone ever reads this, I got an example working with [this commit](https://git.lix.systems/javalsai/lix/commit/5a384d188d3de07084d795ee1a914c65c076fd52). It has to be improved but works.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1208
No description provided.