summaryrefslogtreecommitdiff
path: root/pkgs/build-support/fetchgithub
AgeCommit message (Collapse)Author
3 daysfetchFromGitHub: only override fetchzip onceEman Resu
Funny bug - we were running a .override on fetchzip on every single call to fetchFromGitHub.
2025-12-25fetchFromGitHub: use fetchgit when postCheckout not emptyYueh-Shun Li
2025-12-25tests.fetchFromGitHub: add simple-tagYueh-Shun Li
2025-12-11fetchFromGitHub: simplify useFetchGit and useFetchGitArgsWDPassingYueh-Shun Li
2025-12-09fetchFromGitHub: converge arguments that determines useFetchGitYueh-Shun Li
2025-12-09fetchFromGitHub: explicitly support addditional fetchgit argsYueh-Shun Li
2025-12-04fetchFromGitHub: default sparseCheckout to nullYueh-Shun Li
2025-12-04fetchFromGitHub: elaborate the fetchSubmodules default choiceYueh-Shun Li
2025-12-04fetchFromGitHub: pass leaveDotGit unconditionally using the null defaultYueh-Shun Li
2025-11-03fetchFromGitHub: pass githubBase to mkDerivation via derivationArgsYueh-Shun Li
Reduce future test rebuilds when making githubBase overridable.
2025-11-03fetchFromGitHub: make name respect overridden argumentsYueh-Shun Li
2025-11-03fetchFromGitHub: pass rev uniformlyYueh-Shun Li
2025-11-03fetchFromGitHub: pass tag to mkDerivation uniformlyYueh-Shun Li
2025-11-03fetchFromGitHub: pass owner and repo via derivationArgsYueh-Shun Li
2025-11-03fetchFromGitHub: pass meta via fetcherArgsYueh-Shun Li
2025-10-28fetchFromGitHub: take and unshadow passthruYueh-Shun Li
2025-10-28fetchFromGitHub: prevent user overwriting url and private argumentsYueh-Shun Li
2025-10-18Revert "stdenv: pURL implementation (#421125)"d068328
This reverts commit 54271156702fc3a3f5d156df567a2a4a274bac6b, reversing changes made to 88ee2ac331edc3ce9f9df92aaf824592473ed868.
2025-10-17stdenv: pURL implementation (#421125)Arian van Putten
2025-10-14stdenv: pURL review suggestions - replace mergeHans Joachim Kliemeck
2025-10-14stdenv: pURL - fix chaining case (github&submodules using fetchgit)Hans Joachim Kliemeck
2025-10-10stdenv: pURL review suggestions - part 4Hans Joachim Kliemeck
2025-10-10stdenv: pURL review suggestionsHans Joachim Kliemeck
2025-10-03stdenv: pURL github speed optimizationHans Joachim Kliemeck
2025-10-03stdenv: pURL implementationh0nIg
2025-10-02tests.fetchFromGitHub: initMichael Daniels
Copied from pkgs/build-support/fetchgit/tests.nix, see there for attribution.
2025-10-02fetchFromGitHub: use fetchgit when the rootDir option is setMichael Daniels
This argument was added to fetchgit in #427165, and it's not supported by fetchzip. Co-authored-by: Philip Taron <philip.taron@gmail.com>
2025-05-31lib, treewide: introduce `repoRevToName`, use it in most `fetch*` functionsJan Malakhovski
This patch adds `lib.repoRevToName` function that generalizes away most of the code used for derivation name generation by `fetch*` functions (`fetchzip`, `fetchFromGitHub`, etc, except those which are delayed until latter commits for mass-rebuild reasons). It's first argument controls how the resulting name will look (see below). Since `lib` has no equivalent of Nixpkgs' `config`, this patch adds `config.fetchedSourceNameDefault` option to Nixpkgs and then re-exposes `lib.repoRevToName config.fetchedSourceNameDefault` expression as `pkgs.repoRevToNameMaybe` which is then used in `fetch*` derivations. The result is that different values of `config.fetchedSourceNameDefault` now control how the `src` derivations produced by `fetch*` functions are to be named, e.g.: - `fetchedSourceNameDefault = "source"` (the default): ``` $ nix-instantiate -A fuse.src /nix/store/<hash>-source.drv ``` - `fetchedSourceNameDefault = "versioned"`: ``` $ nix-instantiate -A fuse.src /nix/store/<hash>-libfuse-2.9.9-source.drv ``` - `fetchedSourceNameDefault = "full"`: ``` $ nix-instantiate -A fuse.src /nix/store/<hash>-libfuse-2.9.9-github-source.drv ``` See the documentation of `config.fetchedSourceNameDefault` for more info.
2025-04-01treewide: Format all Nix filesSilvan Mosberger
Format all Nix files using the officially approved formatter, making the CI check introduced in the previous commit succeed: nix-build ci -A fmt.check This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153) of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166). This commit will lead to merge conflicts for a number of PRs, up to an estimated ~1100 (~33%) among the PRs with activity in the past 2 months, but that should be lower than what it would be without the previous [partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537). Merge conflicts caused by this commit can now automatically be resolved while rebasing using the [auto-rebase script](https://github.com/NixOS/nixpkgs/tree/8616af08d915377bd930395f3b700a0e93d08728/maintainers/scripts/auto-rebase). If you run into any problems regarding any of this, please reach out to the [formatting team](https://nixos.org/community/teams/formatting/) by pinging @NixOS/nix-formatting.
2025-03-12fetchFromGitHub: use of the API endpoint only when fetching tarballOlivier LDff
https://github.com/NixOS/nixpkgs/pull/321484 introduced a bug when when `forceFetchGit=true`. This PR revert the change only for this case. The previous PR made work cases like: ```bash nix-build -E 'let pkgs = import ./nixpkgs {}; in pkgs.fetchFromGitHub { owner = "<username>"; repo = "<repo>"; rev = "HEAD"; hash = ""; private=true; forceFetchGit=false; }' ``` You should see the download working and nix complaining about hash mismatch. Now if you take the case where `forceFetchGit=true`, this is a different story: ``` nix-build -E 'let pkgs = import ./nixpkgs {}; in pkgs.fetchFromGitHub { owner = "<username>"; repo = "<repo>"; rev = "HEAD"; hash = ""; private=true; forceFetchGit=true; }' ``` Logs look like: ``` Initialized empty Git repository in /nix/store/<hash>-source/.git/ fatal: could not read Username for 'https://github.com': No such device or address fatal: could not read Username for 'https://github.com': No such device or address fatal: could not read Username for 'https://github.com': No such device or address fatal: could not read Username for 'https://github.com': No such device or address Unable to checkout HEAD from https://github.com/<username>/<repo>.git. ``` I was using `forceFetchGit` for the exact reason the previous PR was made, I will move to `forceFetchGit=false` now. Still the previous PR was a broke usage of `fetchFromGitHub` force private repository when `forceFetchGit` is used.
2025-01-16fetchFromGitHub: refactor for scope clarityAdam Dinwoodie
Co-authored-by: Philip Taron <philip.taron@gmail.com>
2025-01-05fetchFromGitHub: use the API tarball endpointAdam Dinwoodie
GitHub currently has two kinds of personal access token: "classic" and "fine-grained". Fine-grained personal access tokens, as the name suggests, allow much more control over what the token can and cannot do, and in particular allow users to specify which repositories the token should provide access to. Unfortunately, fine-grained tokens don't allow access to repository archive tarballs for private repositories at (say) https://github.com/me-and/private-demo/archive/HEAD.tar.gz. Fortunately, the GitHub API endpoint does provide this access, and also works with classic tokens and -- for public repositories -- no token at all. To allow folk to use fine-grained access tokens, use the GitHub API for accessing private repos. Keep using the existing interface for non-private repos, as we can only assume an authenticated user for private repos, and unauthenticated users have restrictive rate limits on the API interface. Fixes #321481
2024-12-30fetchFromGitHub: passthru `rev` based on `tag`Peder Bergebakken Sundt
2024-12-06fetchFromGitHub: expose tag argumentRobert Schütz
2024-12-05fetchgit{,hub}: assert illegal tag + rev combinationsAtemu
It's quite a bit more complex due to this but this was asked for during review
2024-11-18fetchgit{,hub}: add tag argumentAtemu
It's become a common pattern to use `rev = "refs/tags/${version}"` rather than just `rev = version` to ensure that the tag gets fetched rather than a branch that has the same name. This has so far been done using boilerplate though, so let's add a simple abstraction to fetch a tag instead.
2024-09-04fetchgithub: support fetchLFSsohalt
2024-01-30fetchFromGitHub: fix compatibility issue with nix-prefetchWeijia Wang
2024-01-16Merge #279934: fetchFromGitHub: drop unzipVladimír Čunát
2024-01-12fetchFromGitHub: drop unzipWeijia Wang
2023-12-31build-support/fetchgithub: fix metadata eval for arguments without locationsSergei Trofimovich
Without the change metadata evaluation fails on package like `zammad.src` where no fields are defined in `.nix `files: src = fetchFromGitHub (lib.importJSON ./source.json); There evaluation fails as: $ nix-instantiate --strict --eval --expr 'with import ./. {}; zammad.src.meta' error: 23| # to indicate where derivation originates, similar to make-derivation.nix's mkDerivation 24| position = "${position.file}:${toString position.line}"; | ^ 25| }; error: value is null while a set was expected After the change evaluation succeeds as: $ nix-instantiate --strict --eval --expr 'with import ./. {}; zammad.src.meta' { homepage = "https://github.com/zammad/zammad"; }
2023-06-24treewide: use optionalString instead of 'then ""'Felix Buehler
2023-06-04fetchgit: require sparseCheckout be a list of stringsNicolas Benes
Passing a (multi-line) string was deprecated in #200082 in favour of list of strings, but still supported (with warning). Now, enforce use of list of strings.
2023-04-22treewide: Make some fetchers overridablepiegames
2022-12-10fetchGitHub: inherit owner and repo for use with rocmUpdateScriptMadoura
2022-11-15treewide: make sparseCheckout a list of stringsNicolas Benes
2022-05-24unstableGitUpdater: fix updating fetchzip-based sourcesJan Tojnar
a67950f20b97a293b2fefeecc349c6b785321e4b added `url` attribute from `fetchurl` and therefore also from `fetchzip`. We previously relied on `url` from fetchgit-based fetchers to find the repo URL but now it will just return tarballs in the case of `fetchFrom{GitHub,GitLab}`. Let’s add an attribute to `fetch{git,FromGitHub,FromGitLab}` to expose a repo URL consistently.
2022-02-10fetchFromGitHub: perserve originating positionJonathan Ringer
2022-02-10fetchFromGitHub: don't overwrite metaJonathan Ringer
2022-01-24fetchgithub: Support sparseCheckoutZhong Jianxin