summaryrefslogtreecommitdiff
path: root/pkgs/build-support/fetchgithub (follow)
Commit message (Expand)AuthorAgeFilesLines
* fetchFromGitHub: use fetchgit when postCheckout not emptyYueh-Shun Li2025-12-252-0/+12
* tests.fetchFromGitHub: add simple-tagYueh-Shun Li2025-12-251-0/+8
* fetchFromGitHub: simplify useFetchGit and useFetchGitArgsWDPassingYueh-Shun Li2025-12-111-9/+9
* fetchFromGitHub: converge arguments that determines useFetchGitYueh-Shun Li2025-12-091-39/+58
* fetchFromGitHub: explicitly support addditional fetchgit argsYueh-Shun Li2025-12-091-1/+1
* fetchFromGitHub: default sparseCheckout to nullYueh-Shun Li2025-12-041-2/+2
* fetchFromGitHub: elaborate the fetchSubmodules default choiceYueh-Shun Li2025-12-041-0/+2
* fetchFromGitHub: pass leaveDotGit unconditionally using the null defaultYueh-Shun Li2025-12-041-2/+2
* fetchFromGitHub: pass githubBase to mkDerivation via derivationArgs•••Reduce future test rebuilds when making githubBase overridable. Yueh-Shun Li2025-11-031-0/+2
* fetchFromGitHub: make name respect overridden argumentsYueh-Shun Li2025-11-031-2/+6
* fetchFromGitHub: pass rev uniformlyYueh-Shun Li2025-11-031-5/+8
* fetchFromGitHub: pass tag to mkDerivation uniformlyYueh-Shun Li2025-11-031-1/+1
* fetchFromGitHub: pass owner and repo via derivationArgsYueh-Shun Li2025-11-031-2/+14
* fetchFromGitHub: pass meta via fetcherArgsYueh-Shun Li2025-11-031-1/+1
* fetchFromGitHub: take and unshadow passthruYueh-Shun Li2025-10-281-1/+4
* fetchFromGitHub: prevent user overwriting url and private argumentsYueh-Shun Li2025-10-281-2/+2
* Revert "stdenv: pURL implementation (#421125)"•••This reverts commit 54271156702fc3a3f5d156df567a2a4a274bac6b, reversing changes made to 88ee2ac331edc3ce9f9df92aaf824592473ed868. d0683282025-10-181-18/+1
* stdenv: pURL implementation (#421125)Arian van Putten2025-10-171-1/+18
|\
| * stdenv: pURL review suggestions - replace mergeHans Joachim Kliemeck2025-10-141-17/+20
| * stdenv: pURL - fix chaining case (github&submodules using fetchgit)Hans Joachim Kliemeck2025-10-141-4/+4
| * stdenv: pURL review suggestions - part 4Hans Joachim Kliemeck2025-10-101-6/+1
| * stdenv: pURL review suggestionsHans Joachim Kliemeck2025-10-101-4/+6
| * stdenv: pURL github speed optimizationHans Joachim Kliemeck2025-10-031-29/+21
| * stdenv: pURL implementationh0nIg2025-10-031-9/+34
* | tests.fetchFromGitHub: init•••Copied from pkgs/build-support/fetchgit/tests.nix, see there for attribution. Michael Daniels2025-10-021-0/+119
* | fetchFromGitHub: use fetchgit when the rootDir option is set•••This argument was added to fetchgit in #427165, and it's not supported by fetchzip. Co-authored-by: Philip Taron <philip.taron@gmail.com> Michael Daniels2025-10-021-1/+3
|/
* lib, treewide: introduce `repoRevToName`, use it in most `fetch*` functions•••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. Jan Malakhovski2025-05-311-1/+2
* treewide: Format all Nix files•••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. Silvan Mosberger2025-04-011-87/+151
* fetchFromGitHub: use of the API endpoint only when fetching tarball•••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. Olivier LDff2025-03-121-1/+4
* fetchFromGitHub: refactor for scope clarity•••Co-authored-by: Philip Taron <philip.taron@gmail.com>Adam Dinwoodie2025-01-161-9/+10
* fetchFromGitHub: use the API tarball endpoint•••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 Adam Dinwoodie2025-01-051-12/+29
* fetchFromGitHub: passthru `rev` based on `tag`Peder Bergebakken Sundt2024-12-301-2/+4
* fetchFromGitHub: expose tag argumentRobert Schütz2024-12-061-1/+1
* fetchgit{,hub}: assert illegal tag + rev combinations•••It's quite a bit more complex due to this but this was asked for during review Atemu2024-12-051-4/+7
* fetchgit{,hub}: add tag argument•••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. Atemu2024-11-181-3/+8
* fetchgithub: support fetchLFSsohalt2024-09-041-2/+3
* fetchFromGitHub: fix compatibility issue with nix-prefetchWeijia Wang2024-01-301-1/+5
* Merge #279934: fetchFromGitHub: drop unzipVladimír Čunát2024-01-161-1/+1
|\
| * fetchFromGitHub: drop unzipWeijia Wang2024-01-121-1/+1
* | build-support/fetchgithub: fix metadata eval for arguments without locations•••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"; } Sergei Trofimovich2023-12-311-1/+1
|/
* treewide: use optionalString instead of 'then ""'Felix Buehler2023-06-241-1/+1
* fetchgit: require sparseCheckout be a list of strings•••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. Nicolas Benes2023-06-041-1/+1
* treewide: Make some fetchers overridablepiegames2023-04-221-0/+2
* fetchGitHub: inherit owner and repo for use with rocmUpdateScriptMadoura2022-12-101-1/+1
* treewide: make sparseCheckout a list of stringsNicolas Benes2022-11-151-2/+2
* unstableGitUpdater: fix updating fetchzip-based sources•••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. Jan Tojnar2022-05-241-2/+11
* fetchFromGitHub: perserve originating positionJonathan Ringer2022-02-101-1/+11
* fetchFromGitHub: don't overwrite metaJonathan Ringer2022-02-101-1/+4
* fetchgithub: Support sparseCheckoutZhong Jianxin2022-01-241-2/+3
* fetchgithub: fix eval when passing forceFetchGitSandro Jäckel2021-11-111-1/+1