From 737e372a78fbbc4f9dd8bdb9c7eeefe4d1e233f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fern=C3=A1ndez=20L=C3=B3pez?= Date: Tue, 7 Mar 2023 22:39:05 +0100 Subject: [PATCH] fastly: use viceroy from nix --- pkgs/misc/fastly/default.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/misc/fastly/default.nix b/pkgs/misc/fastly/default.nix index e8db6a8eeccf..743d8cd1c5f2 100644 --- a/pkgs/misc/fastly/default.nix +++ b/pkgs/misc/fastly/default.nix @@ -4,17 +4,19 @@ , installShellFiles , buildGoModule , go +, makeWrapper +, viceroy }: buildGoModule rec { pname = "fastly"; - version = "7.0.1"; + version = "8.0.0"; src = fetchFromGitHub { owner = "fastly"; repo = "cli"; rev = "refs/tags/v${version}"; - hash = "sha256-6M1vdwtw+qjKldW642JN2sanaKV3u9J1qWAoLRNupzE="; + hash = "sha256-Bwof1Np0eSjmBXQ6dqFmw3TA/2u+VzzyIn/95m9eXVo="; # The git commit is part of the `fastly version` original output; # leave that output the same in nixpkgs. Use the `.git` directory # to retrieve the commit SHA, and remove the directory afterwards, @@ -31,10 +33,11 @@ buildGoModule rec { "cmd/fastly" ]; - vendorHash = "sha256-oQwlhlZHpUvGaOyozBpK5W9glzo8VKH7S3vih5c15OA="; + vendorHash = "sha256-/tdvIX839NkhUoj/bfJ/68K8RtPCidydNQZCdDvizzU="; nativeBuildInputs = [ installShellFiles + makeWrapper ]; # Flags as provided by the build automation of the project: @@ -49,14 +52,19 @@ buildGoModule rec { ]; preBuild = let cliConfigToml = fetchurl { - url = "https://web.archive.org/web/20230207211120/https://developer.fastly.com/api/internal/cli-config"; - hash = "sha256-Vkl8V5AkiJMZLswSN0vTnz7S7/5lXftlWD5UZh//vUw="; + url = "https://web.archive.org/web/20230308181550/https://developer.fastly.com/api/internal/cli-config"; + hash = "sha256-Y2KBTiUQlugKjfhOY+8W7/IUSjgeRVc2NgmL+nhb6aQ="; }; in '' cp ${cliConfigToml} ./pkg/config/config.toml ldflags+=" -X github.com/fastly/cli/pkg/revision.GitCommit=$(cat COMMIT)" ''; + preFixup = '' + wrapProgram $out/bin/fastly --prefix PATH : ${lib.makeBinPath [ viceroy ]} \ + --set FASTLY_VICEROY_USE_PATH 1 + ''; + postInstall = '' export HOME="$(mktemp -d)" installShellCompletion --cmd fastly \