summaryrefslogtreecommitdiff
path: root/pkgs/build-support/fetchgitlab (follow)
Commit message (Expand)AuthorAgeFilesLines
* Revert "fetchurl, fetchgitlab: fix curlOpts extension"Yueh-Shun Li2025-12-151-1/+1
* fetchurl, fetchgitlab: fix curlOpts extension•••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 Nicolas Benes2025-12-131-1/+1
* fetchgitlab: pass private tokens/passwords•••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 Nicolas Benes2025-10-111-0/+46
* 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
* fetchFromGitLab: passthru `rev` based on `tag`Peder Bergebakken Sundt2024-12-301-5/+4
* fetchgitlab: add tag argumentwxt2024-12-241-3/+19
* fetchgitlab: nixfmtwxt2024-12-241-27/+78
* Merge pull request #268304 from panicgh/fetchgitlab-sparse-forcegit•••fetchgitlab: add sparseCheckout and forceFetchGit argsPeder Bergebakken Sundt2023-12-171-5/+7
|\
| * fetchgitlab: add option to force fetchgitNicolas Benes2023-11-181-3/+3
| * fetchgitlab: add option for sparse checkoutNicolas Benes2023-11-181-2/+3
| * fetchgitlab: make args more similar to fetchgithubNicolas Benes2023-11-181-3/+4
* | fetchFromGitLab: passthru owner and repo•••this makes the output more consistent with `fetchFromGitHub`. Colin2023-11-271-1/+1
|/
* treewide: Make some fetchers overridablepiegames2023-04-221-0/+2
* fetchFromGitLab: don't passthruAttrs fetchGit specific attrs to fetchUrl•••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 Artturin2022-10-291-1/+1
* 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-1/+7
* fetchgitlab: fix unexpected argumentIgor Sharonov2021-11-181-1/+1
* fetchFromGitLab: Allow overriding protocolMike Purvis2021-09-201-4/+4
* fetchgitlab: add deepClone, fetchSubmodules, leaveDotGit argumentsSandro Jäckel2021-07-221-12/+16
* fetchgitlab: Escape a few more characters in the revisionTethys Svensson2020-09-131-1/+1
* fetchgitlab: escape rev to support "+" in itFlorian Klink2020-05-241-1/+2
* fetchFromGitLab: improve readabilityAlyssa Ross2019-12-091-3/+14
* all-packages: move fetch* to pkgs/build-support/Matthew Bauer2019-01-261-0/+10