From e3a4ba005213c1df01330faf9254ac665e64f8c6 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Mon, 8 Feb 2021 15:28:12 +0100 Subject: [PATCH] terraform-providers: fix impurity about Nix version used I wasn't able to figure out for which unstable version of Nix this is supposed to work so I added nix itself to the package list. Nix will now be the same stable version that is also provided in this nixpkgs checkout. To make it work with a stable Nix version I also had to trim the build error output as otherwise it would contain the sha256 prefix & a newline followed by "error:". --- .../networking/cluster/terraform-providers/update-provider | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/cluster/terraform-providers/update-provider b/pkgs/applications/networking/cluster/terraform-providers/update-provider index e1f1a0ef38a..f97bbce83fa 100755 --- a/pkgs/applications/networking/cluster/terraform-providers/update-provider +++ b/pkgs/applications/networking/cluster/terraform-providers/update-provider @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#! nix-shell -i bash -p coreutils curl jq moreutils +#! nix-shell -I nixpkgs=../../../../.. -i bash -p coreutils curl jq moreutils nix # shellcheck shell=bash # vim: ft=sh # @@ -161,7 +161,8 @@ if [[ -z "$vendorSha256" ]]; then exit 1 fi rm -f vendor_log.txt - vendorSha256=${BASH_REMATCH[1]} + # trim the results in case it they have a sha256: prefix or contain more than one line + vendorSha256=$(echo "${BASH_REMATCH[1]#sha256:}" | head -n 1) # Deal with nix unstable if [[ $vendorSha256 = sha256-* ]]; then vendorSha256=$(nix to-base32 "$vendorSha256")