From 2a0e2dcc899e2a38c8fc977c21d451493e000b76 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 1 Jul 2026 08:55:06 +0200 Subject: [PATCH] gitlab-ci-verify: init at 2.11.8 --- pkgs/by-name/gi/gitlab-ci-verify/package.nix | 65 ++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 pkgs/by-name/gi/gitlab-ci-verify/package.nix diff --git a/pkgs/by-name/gi/gitlab-ci-verify/package.nix b/pkgs/by-name/gi/gitlab-ci-verify/package.nix new file mode 100644 index 000000000000..398e5ce36f3b --- /dev/null +++ b/pkgs/by-name/gi/gitlab-ci-verify/package.nix @@ -0,0 +1,65 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + writableTmpDirAsHomeHook, + versionCheckHook, + nix-update-script, +}: + +buildGoModule (finalAttrs: { + pname = "gitlab-ci-verify"; + version = "2.11.8"; + __structuredAttrs = true; + __darwinAllowLocalNetworking = true; + + src = fetchFromGitHub { + owner = "timo-reymann"; + repo = "gitlab-ci-verify"; + tag = "v${finalAttrs.version}"; + hash = "sha256-/HzVfaRBPfG+YjHHzwE5ROYBjR+8Lqxusku7l46oXaM="; + fetchSubmodules = true; + leaveDotGit = true; + postFetch = '' + cd "$out" + git rev-parse HEAD > $out/COMMIT + date -u -d "@$(git log -1 --pretty=%ct)" "+%Y-%m-%dT%H:%M:%SZ" > $out/SOURCE_DATE_EPOCH + find "$out" -name .git -print0 | xargs -0 rm -rf + ''; + }; + + vendorHash = "sha256-o7NL6Ijh+ZEUhEYlzypM0KPh8XtMXeTzB9VBB7bPlco="; + + ldflags = [ + "-s" + "-w" + ]; + + # Using -X github.com/timo-reymann/gitlab-ci-verify/internal/buildinfo.Version does not work + preBuild = '' + substituteInPlace internal/buildinfo/main.go \ + --replace-fail "unknown" "$(cat COMMIT)" \ + --replace-fail "Version = \"?\"" "Version = \"${finalAttrs.version}\"" \ + --replace-fail "BuildTime = \"?\"" "BuildTime = \"$(cat SOURCE_DATE_EPOCH)\"" + ''; + + doCheck = true; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + ]; + + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Validate and lint your gitlab ci files using ShellCheck, the Gitlab API, curated checks or even build your own checks"; + homepage = "https://github.com/timo-reymann/gitlab-ci-verify"; + changelog = "https://github.com/timo-reymann/gitlab-ci-verify/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ drupol ]; + mainProgram = "gitlab-ci-verify"; + }; +})