diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/admin/pulumi')
-rw-r--r-- | nixpkgs/pkgs/tools/admin/pulumi/data.nix | 51 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/admin/pulumi/default.nix | 36 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/admin/pulumi/update.sh | 55 |
3 files changed, 142 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/admin/pulumi/data.nix b/nixpkgs/pkgs/tools/admin/pulumi/data.nix new file mode 100644 index 000000000000..cad7b97fd37d --- /dev/null +++ b/nixpkgs/pkgs/tools/admin/pulumi/data.nix @@ -0,0 +1,51 @@ +# DO NOT EDIT! This file is generated automatically by update.sh +{ }: +{ + version = "2.1.0"; + pulumiPkgs = { + x86_64-linux = [ + { + url = "https://get.pulumi.com/releases/sdk/pulumi-v2.1.0-linux-x64.tar.gz"; + sha256 = "0d9bmljgf62dhj1z8h71c2pj2cbvf4ghhlbbbh2jcg55i33ks8ih"; + } + { + url = "https://api.pulumi.com/releases/plugins/pulumi-resource-random-v2.1.0-linux-amd64.tar.gz"; + sha256 = "1kf43j1b4wp39sny92dnsy1myn6wb2msli1ydds3yza81srgcfnh"; + } + { + url = "https://api.pulumi.com/releases/plugins/pulumi-resource-gcp-v3.3.0-linux-amd64.tar.gz"; + sha256 = "17anj9pc90hhiknyf2yab7dzvcfbjn1803bl6ld26r701w3h1jqx"; + } + { + url = "https://api.pulumi.com/releases/plugins/pulumi-resource-kubernetes-v2.0.0-linux-amd64.tar.gz"; + sha256 = "0526a4ll1q9v566i313223pnx2pa3qkcjp01l49h5jmgn8qpw1fn"; + } + { + url = "https://api.pulumi.com/releases/plugins/pulumi-resource-aws-v2.2.0-linux-amd64.tar.gz"; + sha256 = "14ya2sax2yyza3zbxp5a638y81pcbi26hv8k9y8agnjn82bgx8dy"; + } + ]; + x86_64-darwin = [ + { + url = "https://get.pulumi.com/releases/sdk/pulumi-v2.1.0-darwin-x64.tar.gz"; + sha256 = "1d7w32wac2sc0z5i893h66fgyivf4x3mqki649vxkxc3081kpzi9"; + } + { + url = "https://api.pulumi.com/releases/plugins/pulumi-resource-random-v2.1.0-darwin-amd64.tar.gz"; + sha256 = "1smy1y2pnxnvw8zcs31q9xs80hyqhzawfzcwkkfnyamdrgasxqsi"; + } + { + url = "https://api.pulumi.com/releases/plugins/pulumi-resource-gcp-v3.3.0-darwin-amd64.tar.gz"; + sha256 = "03idn1livy9w3izi7qrdgnigx3ayrp8qp2q3m5ik9ffvv2g11962"; + } + { + url = "https://api.pulumi.com/releases/plugins/pulumi-resource-kubernetes-v2.0.0-darwin-amd64.tar.gz"; + sha256 = "06m6ldqa82w82kjz7pxi0pbk9x02pzsy4x0in8fcq9gsh1p0gka9"; + } + { + url = "https://api.pulumi.com/releases/plugins/pulumi-resource-aws-v2.2.0-darwin-amd64.tar.gz"; + sha256 = "0mymvn2355bq9ykvnww0si0imikzxp7mp1yh2scn8kjn2gs4nhgk"; + } + ]; + }; +} diff --git a/nixpkgs/pkgs/tools/admin/pulumi/default.nix b/nixpkgs/pkgs/tools/admin/pulumi/default.nix new file mode 100644 index 000000000000..c0547f0c0c89 --- /dev/null +++ b/nixpkgs/pkgs/tools/admin/pulumi/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchurl, autoPatchelfHook, makeWrapper }: + +with lib; + +let + data = import ./data.nix {}; +in stdenv.mkDerivation { + pname = "pulumi"; + version = data.version; + + postUnpack = '' + mv pulumi-* pulumi + ''; + + srcs = map (x: fetchurl x) data.pulumiPkgs.${stdenv.hostPlatform.system}; + + installPhase = '' + mkdir -p $out/bin + cp * $out/bin/ + '' + optionalString stdenv.isLinux '' + wrapProgram $out/bin/pulumi --set LD_LIBRARY_PATH "${stdenv.cc.cc.lib}/lib" + ''; + + nativeBuildInputs = optionals stdenv.isLinux [ autoPatchelfHook makeWrapper ]; + + meta = { + homepage = "https://pulumi.io/"; + description = "Pulumi is a cloud development platform that makes creating cloud programs easy and productive"; + license = with licenses; [ asl20 ]; + platforms = builtins.attrNames data.pulumiPkgs; + maintainers = with maintainers; [ + peterromfeldhk + jlesquembre + ]; + }; +} diff --git a/nixpkgs/pkgs/tools/admin/pulumi/update.sh b/nixpkgs/pkgs/tools/admin/pulumi/update.sh new file mode 100644 index 000000000000..26a48469841c --- /dev/null +++ b/nixpkgs/pkgs/tools/admin/pulumi/update.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +VERSION="2.1.0" + +declare -A plugins +plugins=( + ["aws"]="2.2.0" + ["gcp"]="3.3.0" + ["random"]="2.1.0" + ["kubernetes"]="2.0.0" +) + +function genMainSrc() { + local url="https://get.pulumi.com/releases/sdk/pulumi-v${VERSION}-$1-x64.tar.gz" + local sha256 + sha256=$(nix-prefetch-url "$url") + echo " {" + echo " url = \"${url}\";" + echo " sha256 = \"$sha256\";" + echo " }" +} + +function genSrcs() { + for plug in "${!plugins[@]}"; do + local version=${plugins[$plug]} + # url as defined here + # https://github.com/pulumi/pulumi/blob/06d4dde8898b2a0de2c3c7ff8e45f97495b89d82/pkg/workspace/plugins.go#L197 + local url="https://api.pulumi.com/releases/plugins/pulumi-resource-${plug}-v${version}-$1-amd64.tar.gz" + local sha256 + sha256=$(nix-prefetch-url "$url") + echo " {" + echo " url = \"${url}\";" + echo " sha256 = \"$sha256\";" + echo " }" + done +} + +cat <<EOF +# DO NOT EDIT! This file is generated automatically by update.sh +{ }: +{ + version = "${VERSION}"; + pulumiPkgs = { + x86_64-linux = [ +EOF +genMainSrc "linux" +genSrcs "linux" +echo " ];" + +echo " x86_64-darwin = [" +genMainSrc "darwin" +genSrcs "darwin" +echo " ];" +echo " };" +echo "}" |