-
-
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
Flake inputs should be able to do a sparse checkout of a Git repository #5811
Comments
This is now implemented in I would love to have this available in {
inputs = {
pytorch = {
url = "github:me/nixpkgs";
ref = "pytorch-1.11.0";
subtree = "pkgs/development/python-modules/pytorch"; # or sparseCheckout
flake = false;
};
};
outputs = { self, ... }: {
overlays.default = final: prev: {
pytorch_1_11_0 = final.callPackage self.inputs.pytorch {};
pytorch-bin_1_11_0 = final.callPackage "${self.inputs.pytorch}/bin.nix" {};
};
};
} |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixpkgss-current-development-workflow-is-not-sustainable/18741/69 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
This feature was merged some time ago and this issue should be closed. |
@quasigod-io I did some searching and can't find a PR or documentation for this feature. Can you point me to where this was implemented? |
Nevermind, I made a mistake reading this issue last night. My apologies. |
do we have example repo to look at? so we can be sure it works? |
Is your feature request related to a problem? Please describe.
Being able to get a subset of the files for very big repositories is often necessary. For example, I had to download the entire repository (~2.7GiB) of ryanoasis/nerd-fonts just to use the 53.7 KiB
font-patcher
script in the root. Similarly, using the same nerd-fonts repository, I may only want to download thepatched-fonts/FantasqueSansMono/
directory and ignore the rest of the files.Describe the solution you'd like
In flake inputs, it should be possible to specify a subset of files / directories from a Git repository, and the flake fetcher automatically tries something like a sparse checkout before falling back to simply cloning the full repository. This may be useful for more than just Git repositories, too.
Describe alternatives you've considered
For fetching single files from GitHub repositories, one can use
fetchurl
; but this doesn't fit with the entire model of flakes as a whole (nix flake update
won't update it, etc.) Also, this doesn't work for directories.The text was updated successfully, but these errors were encountered: