google-cloud-sdk: add update script
This commit is contained in:
parent
30027eb71f
commit
9c8008113a
32
pkgs/tools/admin/google-cloud-sdk/data.nix
Normal file
32
pkgs/tools/admin/google-cloud-sdk/data.nix
Normal file
@ -0,0 +1,32 @@
|
||||
# DO NOT EDIT! This file is generated automatically by update.sh
|
||||
{ }:
|
||||
{
|
||||
version = "364.0.0";
|
||||
googleCloudSdkPkgs = {
|
||||
x86_64-linux =
|
||||
{
|
||||
url = "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-364.0.0-linux-x86_64.tar.gz";
|
||||
sha256 = "0i9h61qsd0pmvypjkmp8nzgrdr3n6wdvmizrsnm9azrsmsqbx4cl";
|
||||
};
|
||||
x86_64-darwin =
|
||||
{
|
||||
url = "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-364.0.0-darwin-x86_64.tar.gz";
|
||||
sha256 = "0p2jpzkd0mn70wvs5m6xh9v1f5wfxww6miz2xgd50wa71kh5q9hl";
|
||||
};
|
||||
aarch64-linux =
|
||||
{
|
||||
url = "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-364.0.0-linux-arm.tar.gz";
|
||||
sha256 = "0v8hrymq0iwrw936v7bll012gi20zrhjn4jjgn940y5rrdz7pk2i";
|
||||
};
|
||||
aarch64-darwin =
|
||||
{
|
||||
url = "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-364.0.0-darwin-arm.tar.gz";
|
||||
sha256 = "0lp5l79dm263ymm32abkz7hnfb9zwhwi9xspr2gx8h4jgpw4hmxm";
|
||||
};
|
||||
i686-linux =
|
||||
{
|
||||
url = "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-364.0.0-linux-x86.tar.gz";
|
||||
sha256 = "1cfh5bx7zcjbjqbsin4aqd10jlaibbckgjpp16lh4aywrysdfdzh";
|
||||
};
|
||||
};
|
||||
}
|
@ -17,39 +17,15 @@ let
|
||||
crcmod
|
||||
] ++ lib.optional (with-gce) google-compute-engine);
|
||||
|
||||
baseUrl = "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads";
|
||||
sources = name: system: {
|
||||
x86_64-darwin = {
|
||||
url = "${baseUrl}/${name}-darwin-x86_64.tar.gz";
|
||||
sha256 = "0p2jpzkd0mn70wvs5m6xh9v1f5wfxww6miz2xgd50wa71kh5q9hl";
|
||||
};
|
||||
|
||||
aarch64-darwin = {
|
||||
url = "${baseUrl}/${name}-darwin-arm.tar.gz";
|
||||
sha256 = "0lp5l79dm263ymm32abkz7hnfb9zwhwi9xspr2gx8h4jgpw4hmxm";
|
||||
};
|
||||
|
||||
x86_64-linux = {
|
||||
url = "${baseUrl}/${name}-linux-x86_64.tar.gz";
|
||||
sha256 = "0i9h61qsd0pmvypjkmp8nzgrdr3n6wdvmizrsnm9azrsmsqbx4cl";
|
||||
};
|
||||
|
||||
i686-linux = {
|
||||
url = "${baseUrl}/${name}-linux-x86.tar.gz";
|
||||
sha256 = "1cfh5bx7zcjbjqbsin4aqd10jlaibbckgjpp16lh4aywrysdfdzh";
|
||||
};
|
||||
|
||||
aarch64-linux = {
|
||||
url = "${baseUrl}/${name}-linux-arm.tar.gz";
|
||||
sha256 = "0v8hrymq0iwrw936v7bll012gi20zrhjn4jjgn940y5rrdz7pk2i";
|
||||
};
|
||||
}.${system} or (throw "Unsupported system: ${system}");
|
||||
data = import ./data.nix { };
|
||||
sources = system:
|
||||
data.googleCloudSdkPkgs.${system} or (throw "Unsupported system: ${system}");
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "google-cloud-sdk";
|
||||
version = "364.0.0";
|
||||
inherit (data) version;
|
||||
|
||||
src = fetchurl (sources "${pname}-${version}" stdenv.hostPlatform.system);
|
||||
src = fetchurl (sources stdenv.hostPlatform.system);
|
||||
|
||||
buildInputs = [ python ];
|
||||
|
||||
@ -128,8 +104,9 @@ in stdenv.mkDerivation rec {
|
||||
# This package contains vendored dependencies. All have free licenses.
|
||||
license = licenses.free;
|
||||
homepage = "https://cloud.google.com/sdk/";
|
||||
changelog = "https://cloud.google.com/sdk/docs/release-notes";
|
||||
maintainers = with maintainers; [ iammrinal0 pradyuman stephenmw zimbatm ];
|
||||
platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
||||
platforms = builtins.attrNames data.googleCloudSdkPkgs;
|
||||
mainProgram = "gcloud";
|
||||
};
|
||||
}
|
||||
|
47
pkgs/tools/admin/google-cloud-sdk/update.sh
Executable file
47
pkgs/tools/admin/google-cloud-sdk/update.sh
Executable file
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nix
|
||||
|
||||
BASE_URL="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk"
|
||||
|
||||
# Version of Google Cloud SDK from
|
||||
# https://cloud.google.com/sdk/docs/release-notes
|
||||
VERSION="364.0.0"
|
||||
|
||||
function genMainSrc() {
|
||||
local url="${BASE_URL}-${VERSION}-${1}-${2}.tar.gz"
|
||||
local sha256
|
||||
sha256=$(nix-prefetch-url "$url")
|
||||
echo " {"
|
||||
echo " url = \"${url}\";"
|
||||
echo " sha256 = \"${sha256}\";"
|
||||
echo " };"
|
||||
}
|
||||
|
||||
{
|
||||
cat <<EOF
|
||||
# DO NOT EDIT! This file is generated automatically by update.sh
|
||||
{ }:
|
||||
{
|
||||
version = "${VERSION}";
|
||||
googleCloudSdkPkgs = {
|
||||
EOF
|
||||
|
||||
echo " x86_64-linux ="
|
||||
genMainSrc "linux" "x86_64"
|
||||
|
||||
echo " x86_64-darwin ="
|
||||
genMainSrc "darwin" "x86_64"
|
||||
|
||||
echo " aarch64-linux ="
|
||||
genMainSrc "linux" "arm"
|
||||
|
||||
echo " aarch64-darwin ="
|
||||
genMainSrc "darwin" "arm"
|
||||
|
||||
echo " i686-linux ="
|
||||
genMainSrc "linux" "x86"
|
||||
|
||||
echo " };"
|
||||
echo "}"
|
||||
|
||||
} >data.nix
|
Loading…
Reference in New Issue
Block a user