10 let versions = lib.importJSON ./versions.json;
11 arch = if stdenvNoCC.hostPlatform.isx86_64 then "amd64"
12 else if stdenvNoCC.hostPlatform.isAarch64 then "arm64"
13 else throw "Unsupported architecture";
14 os = if stdenvNoCC.hostPlatform.isLinux then "linux"
15 else if stdenvNoCC.hostPlatform.isDarwin then "darwin"
16 else throw "Unsupported os";
17 versionInfo = versions."${os}-${arch}";
18 inherit (versionInfo) hash url;
21 stdenvNoCC.mkDerivation (finalAttrs: {
23 inherit (versions) version;
25 nativeBuildInputs = [ installShellFiles ];
28 src = fetchurl { inherit hash url; };
37 install -Dm755 platform $out/bin/platform
39 installShellCompletion completion/bash/platform.bash \
40 completion/zsh/_platform
46 updateScript = ./update.sh;
47 tests.version = testers.testVersion {
48 inherit (finalAttrs) version;
54 description = "Unified tool for managing your Platform.sh services from the command line";
55 homepage = "https://github.com/platformsh/cli";
56 license = lib.licenses.mit;
57 mainProgram = "platform";
58 maintainers = with lib.maintainers; [ shyim spk ];
59 platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
60 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];