From b7641eaa5a689decfd3fc2c0e74d475eb20bbd64 Mon Sep 17 00:00:00 2001 From: edef Date: Fri, 31 Jan 2020 08:53:02 +0000 Subject: [PATCH] google-cloud-sdk: compact all the JSON This reduces output size by 20 MiB. --- pkgs/tools/admin/google-cloud-sdk/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/admin/google-cloud-sdk/default.nix b/pkgs/tools/admin/google-cloud-sdk/default.nix index fccd3d12acf..1a19d92984e 100644 --- a/pkgs/tools/admin/google-cloud-sdk/default.nix +++ b/pkgs/tools/admin/google-cloud-sdk/default.nix @@ -7,7 +7,7 @@ # 3) used by `google-cloud-sdk` only on GCE guests # -{ stdenv, lib, fetchurl, makeWrapper, python, openssl, with-gce ? false }: +{ stdenv, lib, fetchurl, makeWrapper, python, openssl, jq, with-gce ? false }: let pythonEnv = python.withPackages (p: with p; [ @@ -38,6 +38,8 @@ in stdenv.mkDerivation rec { buildInputs = [ python makeWrapper ]; + nativeBuildInputs = [ jq ]; + patches = [ ./gcloud-path.patch ]; @@ -81,6 +83,12 @@ in stdenv.mkDerivation rec { # remove tests and test data find $out -name tests -type d -exec rm -rf '{}' + + + # compact all the JSON + find $out -name \*.json | while read path; do + jq -c . $path > $path.min + mv $path.min $path + done ''; meta = with stdenv.lib; {