From 74bb6c8e5d0c9b4ecb91a6a88a5ef3d050aaddfe Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Wed, 6 Nov 2024 22:09:20 +0100 Subject: [PATCH] dependabot-cli: Split image version into a separate derivation --- pkgs/by-name/de/dependabot-cli/package.nix | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/de/dependabot-cli/package.nix b/pkgs/by-name/de/dependabot-cli/package.nix index 38004fe0a502..c83fdb474c9e 100644 --- a/pkgs/by-name/de/dependabot-cli/package.nix +++ b/pkgs/by-name/de/dependabot-cli/package.nix @@ -6,6 +6,7 @@ installShellFiles, lib, makeWrapper, + symlinkJoin, testers, }: let @@ -65,13 +66,6 @@ buildGoModule { --bash <($out/bin/dependabot completion bash) \ --fish <($out/bin/dependabot completion fish) \ --zsh <($out/bin/dependabot completion zsh) - - # Create a wrapper that pins the docker images that are depended upon - makeWrapper $out/bin/dependabot $out/bin/dependabot-pinned \ - --run "docker load --input ${updateJobProxy}" \ - --add-flags "--proxy-image=dependabot-update-job-proxy:${tag}" \ - --run "docker load --input ${updaterGitHubActions}" \ - --add-flags "--updater-image=dependabot-updater-github-actions:${tag}" ''; checkFlags = [ @@ -83,6 +77,20 @@ buildGoModule { $out/bin/dependabot --help ''; + passthru.withDockerImages = symlinkJoin { + name = "dependabot-cli-with-docker-images"; + paths = [ dependabot-cli ]; + buildInputs = [ makeWrapper ]; + postBuild = '' + # Create a wrapper that pins the docker images that are depended upon + wrapProgram $out/bin/dependabot \ + --run "docker load --input ${updateJobProxy} >&2" \ + --add-flags "--proxy-image=dependabot-update-job-proxy:${tag}" \ + --run "docker load --input ${updaterGitHubActions} >&2" \ + --add-flags "--updater-image=dependabot-updater-github-actions:${tag}" + ''; + }; + passthru.tests.version = testers.testVersion { package = dependabot-cli; command = "dependabot --version";