summaryrefslogtreecommitdiff
path: root/pkgs/build-support/fetchgitlab
AgeCommit message (Collapse)Author
2025-12-15Revert "fetchurl, fetchgitlab: fix curlOpts extension"Yueh-Shun Li
2025-12-13fetchurl, fetchgitlab: fix curlOpts extensionNicolas Benes
PR #464475 enables __structuredAttrs and makes curlOpts a bash array. Consequently, it must be extended as such to be effective. See also https://github.com/NixOS/nixpkgs/pull/464475#issuecomment-3649765507
2025-10-11fetchgitlab: pass private tokens/passwordsNicolas Benes
Allow the fetcher to authenticate with user name and password. Note: as of now, GitLab ignores the user name (it must be set, but the value does not matter) but this may change in the future: https://gitlab.com/gitlab-org/gitlab/-/issues/212953 Credentials can be passed to the nix-daemon, for example, via a read-protected `EnvironmentFile`: ```console $ ls -l /to/secrets.txt -rw------- 1 root root 100 Nov 1 10:42 /to/secrets.txt ``` In /to/secrets.txt: ``` # for `fetchFromGitLab { private=true; ... }` NIX_GITLAB_PRIVATE_USERNAME=whatever NIX_GITLAB_PRIVATE_PASSWORD=glpat-the-access-token # for `fetchFromGitLab { private=true; varPrefix="EXAMPLE"; ... }` NIX_EXAMPLE_GITLAB_PRIVATE_USERNAME=whatever NIX_EXAMPLE_GITLAB_PRIVATE_PASSWORD=glpat-another-access-token ``` In /etc/nixos/configuration.nix: ```nix { config, pkgs, ... }: { systemd.services.nix-daemon.serviceConfig.EnvironmentFile = "/to/secrets.txt"; } ``` GitLab supports HTTP Basic Authentication (credentials in `.netrc` file) only if accessed via Git. Access via the GitLab API requires a custom header (e.g. `PRIVATE-TOKEN`) instead. See: * https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html#project-access-tokens * https://docs.gitlab.com/ee/api/rest/authentication.html#personalprojectgroup-access-tokens
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.
2024-12-30fetchFromGitLab: passthru `rev` based on `tag`Peder Bergebakken Sundt
2024-12-24fetchgitlab: add tag argumentwxt
2024-12-24fetchgitlab: nixfmtwxt
2023-12-17Merge pull request #268304 from panicgh/fetchgitlab-sparse-forcegitPeder Bergebakken Sundt
fetchgitlab: add sparseCheckout and forceFetchGit args
2023-11-27fetchFromGitLab: passthru owner and repoColin
this makes the output more consistent with `fetchFromGitHub`.
2023-11-18fetchgitlab: add option to force fetchgitNicolas Benes
2023-11-18fetchgitlab: add option for sparse checkoutNicolas Benes
2023-11-18fetchgitlab: make args more similar to fetchgithubNicolas Benes
2023-04-22treewide: Make some fetchers overridablepiegames
2022-10-29fetchFromGitLab: don't passthruAttrs fetchGit specific attrs to fetchUrlArtturin
if `fetchSubmodules = false` to 'fetchFromGitLab' then theres the following error error: anonymous function at /nix/store/9m8drnpifyl5qsx93g6ll2xw6wkps03z-source/pkgs/build-support/fetchurl/default.nix:41:1 called with unexpected argument 'fetchSubmodules' at /nix/store/9m8drnpifyl5qsx93g6ll2xw6wkps03z-source/pkgs/build-support/fetchzip/default.nix:36:1: 35| 36| fetchurl (( | ^ 37| if (pname != "" && version != "") then
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.
2021-11-18fetchgitlab: fix unexpected argumentIgor Sharonov
2021-09-20fetchFromGitLab: Allow overriding protocolMike Purvis
2021-07-22fetchgitlab: add deepClone, fetchSubmodules, leaveDotGit argumentsSandro Jäckel
2020-09-13fetchgitlab: Escape a few more characters in the revisionTethys Svensson
2020-05-24fetchgitlab: escape rev to support "+" in itFlorian Klink
2019-12-09fetchFromGitLab: improve readabilityAlyssa Ross
2019-01-26all-packages: move fetch* to pkgs/build-support/Matthew Bauer