Skip to content
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

feat(back): #1343 deprecate args git fetchers #1344

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 0 additions & 74 deletions docs/src/api/extensions/fetchers.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,80 +66,6 @@ Example:
}
```

## fetchGithub

Fetch a commit from the specified Git repository at GitHub.

Types:

- fetchGithub (`function { ... } -> package`):
- owner (`str`):
Owner of the repository.
- repo (`str`):
Name of the repository.
- rev (`str`):
Commit, branch or tag to fetch.
- sha256 (`str`):
SHA256 of the expected output,
In order to get the SHA256
you can omit this parameter and execute Makes,
Makes will tell you the correct SHA256 on failure.

Example:

=== "main.nix"

```nix
# /path/to/my/project/makes/example/main.nix
{
fetchGithub,
...
}:
fetchGithub {
owner = "kamadorueda";
repo = "mailmap-linter";
rev = "e0799aa47ac5ce6776ca8581ba50ace362e5d0ce";
sha256 = "02nr39rn4hicfam1rccbqhn6w6pl25xq7fl2kw0s0ahxzvfk24mh";
}
```

## fetchGitlab

Fetch a commit from the specified Git repository at GitLab.

Types:

- fetchGitlab (`function { ... } -> package`):
- owner (`str`):
Owner of the repository.
- repo (`str`):
Name of the repository.
- rev (`str`):
Commit, branch or tag to fetch.
- sha256 (`str`):
SHA256 of the expected output,
In order to get the SHA256
you can omit this parameter and execute Makes,
Makes will tell you the correct SHA256 on failure.

Example:

=== "main.nix"

```nix
# /path/to/my/project/makes/example/main.nix
{
fetchGitlab,
...
}:
fetchGitlab {
owner = "fluidattacks";
repo = "product";
rev = "ff231a9bf8aa3f0807f3431b402e7af08d136341";
sha256 = "1sfbif0bchdpw4rlfpv9gs4l4bmg8l24fqh2hg6m39msrvh1w6h3";
}
```

## fetchNixpkgs

Fetch a commit from the
Expand Down
2 changes: 0 additions & 2 deletions src/args/agnostic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ let
inherit (__nixpkgs__.lib.strings) escapeShellArgs;
inherit (__nixpkgs__.lib) fakeSha256;
fetchArchive = import ./fetch-archive/default.nix self;
fetchGithub = import ./fetch-github/default.nix self;
fetchGitlab = import ./fetch-gitlab/default.nix self;
fetchNixpkgs = import ./fetch-nixpkgs/default.nix self;
fetchRubyGem = import ./fetch-rubygem/default.nix self;
fetchUrl = import ./fetch-url/default.nix self;
Expand Down
6 changes: 0 additions & 6 deletions src/args/fetch-github/default.nix

This file was deleted.

6 changes: 0 additions & 6 deletions src/args/fetch-gitlab/default.nix

This file was deleted.

8 changes: 3 additions & 5 deletions src/args/fetch-nixpkgs/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{ fakeSha256, fetchGithub, ... }:
{ fakeSha256, ... }:
{ rev, acceptAndroidSdkLicense ? true, allowUnfree ? true, overlays ? [ ]
, sha256 ? fakeSha256, }:
import (fetchGithub {
inherit rev;
owner = "nixos";
repo = "nixpkgs";
import (builtins.fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
inherit sha256;
}) {
config = {
Expand Down
12 changes: 6 additions & 6 deletions src/args/lint-git-mailmap/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ __nixpkgs__, fetchGithub, makeScript, ... }:
{ __nixpkgs__, makeScript, ... }:
{ name, src, exclude, }:
let
mailmapLinter = fetchGithub {
owner = "kamadorueda";
repo = "mailmap-linter";
rev = "ffed6a68e507228d7e462642a8ec129f816b6a5d";
sha256 = "XHmqLTT7TZ/dXBtQSH1xkEGSWI4mpImt+KRqBHbfGLk=";
rev = "ffed6a68e507228d7e462642a8ec129f816b6a5d";
sha256 = "XHmqLTT7TZ/dXBtQSH1xkEGSWI4mpImt+KRqBHbfGLk=";
mailmapLinter = builtins.fetchTarball {
url = "https://github.com/kamadorueda/mailmap-linter/archive/${rev}.tar.gz";
inherit sha256;
};
in makeScript {
entrypoint = ./entrypoint.sh;
Expand Down
9 changes: 4 additions & 5 deletions src/args/secure-kubernetes-with-rbac-police/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ __nixpkgs__, fetchGithub, fetchUrl, makeDerivation, makeScript, ... }:
{ __nixpkgs__, fetchUrl, makeDerivation, makeScript, ... }:
{ name, setup, severity, ... }:
let
bin = makeDerivation {
Expand All @@ -18,10 +18,9 @@ let
patchelf --set-interpreter "$envGlibc/lib/ld-linux-x86-64.so.2" "$out"
'';
};
repo = fetchGithub {
owner = "PaloAltoNetworks";
repo = "rbac-police";
rev = "ffe47f709a747fc92cbeeb2eec688b4ea544b958";
repo = builtins.fetchTarball {
url =
"https://github.com/PaloAltoNetworks/rbac-police/archive/ffe47f709a747fc92cbeeb2eec688b4ea544b958.tar.gz";
sha256 = "0hna14rwkfadqq2higzz033hkdpxpnzi5vg340xsk50ipr41g689";
};
in makeScript {
Expand Down
Loading