From c857e4cd2e60f34f12b7a148d994f91bbc8cc9de Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 25 Mar 2023 15:22:30 +0100 Subject: [PATCH] pkgs: add woodpecker-plugin-git --- pkgs/default.nix | 2 ++ pkgs/woodpecker-plugin-git/default.nix | 37 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 pkgs/woodpecker-plugin-git/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index dd92dc5..33775c6 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -48,5 +48,7 @@ pkgs.lib.makeScope pkgs.newScope (pkgs: { woodpecker-frontend = pkgs.callPackage ./woodpecker/frontend.nix { }; + woodpecker-plugin-git = pkgs.callPackage ./woodpecker-plugin-git { }; + woodpecker-server = pkgs.callPackage ./woodpecker/server.nix { }; }) diff --git a/pkgs/woodpecker-plugin-git/default.nix b/pkgs/woodpecker-plugin-git/default.nix new file mode 100644 index 0000000..8411216 --- /dev/null +++ b/pkgs/woodpecker-plugin-git/default.nix @@ -0,0 +1,37 @@ +{ lib, buildGoModule, fetchFromGitHub, fetchpatch }: +buildGoModule rec { + pname = "woodpecker-plugin-git"; + version = "2.0.3"; + + src = fetchFromGitHub { + owner = "woodpecker-ci"; + repo = "plugin-git"; + rev = "v${version}"; + hash = "sha256-KU/A3V7KS8R1nAZoJJwkDc9C8y3t148kUzGnkeYtFjs="; + }; + + vendorHash = "sha256-63Ly/9yIJu2K/DwOfGs9pYU3fokbs2senZkl3MJ1UIY="; + + patches = [ + # https://github.com/woodpecker-ci/plugin-git/pull/67 + (fetchpatch { + name = "do-not-overwrite-command-env.patch"; + url = "https://github.com/woodpecker-ci/plugin-git/commit/970cc63a9b212872deac565c6292feb3f4cf4b51.patch"; + hash = "sha256-izu0X7j+OyNbrOkksf+7VF3KiKVylVv2o00xaX/b1Rg="; + }) + ]; + + CGO_ENABLED = "0"; + + # Checks fail because they require network access. + doCheck = false; + + meta = with lib; { + description = "Woodpecker plugin for cloning Git repositories."; + homepage = "https://woodpecker-ci.org/"; + license = licenses.asl20; + mainProgram = "pluging-git"; + maintainers = with maintainers; [ thehedgeh0g ]; + platforms = platforms.all; + }; +}