11 common-updater-scripts,
14 stdenv.mkDerivation (finalAttrs: {
19 finalAttrs.passthru.sources.${stdenv.system}
20 or (throw "gk-cli ${finalAttrs.version} unsupported system: ${stdenv.system}")
31 install -Dm555 gk -t $out/bin/
33 installShellCompletion --bash ./**/gk.bash
34 installShellCompletion --fish ./**/gk.fish
35 installShellCompletion --zsh ./**/_gk
41 wrapProgram $out/bin/gk \
42 --prefix PATH : "${lib.makeBinPath [ coreutils ]}"
48 base_url = "https://github.com/gitkraken/gk-cli/releases/download/v${finalAttrs.version}/gk_${finalAttrs.version}_";
51 armv6l-linux = fetchzip {
52 url = "${base_url}Linux_arm6.zip";
53 hash = "sha256-pnEFTkx1JSmQlniVCXvIB6xGD8XyDh9OLDU0V9AZBTs=";
56 armv7l-linux = fetchzip {
57 url = "${base_url}Linux_arm7.zip";
58 hash = "sha256-qj0++i698s4ELKHU9B2sGIqf9hUJip4+2Car+brkRkM=";
61 aarch64-linux = fetchzip {
62 url = "${base_url}Linux_arm64.zip";
63 hash = "sha256-vHGhlRHbk2/s3YmBdOPDbalEydpQVFkHiCkBVywa4N0=";
66 x86_32-linux = fetchzip {
67 url = "${base_url}Linux_i386.zip";
68 hash = "sha256-t+P9SpS9u/17kga74kbYjD6nkjiFusyIwCRGDnkP3tU=";
71 x86_64-linux = fetchzip {
72 url = "${base_url}Linux_x86_64.zip";
73 hash = "sha256-O6T27edHi20ZFHiNaZKdk/5dtCn2Tpxm0PR934SRwFk=";
76 aarch64-darwin = fetchzip {
77 url = "${base_url}macOS_arm64.zip";
78 hash = "sha256-LW2K+aveJiyYqfga2jpF3DvvFeHJuozqbc/afgtq2Oc=";
81 x86_64-darwin = fetchzip {
82 url = "${base_url}macOS_x86_64.zip";
83 hash = "sha256-1w8B4YWouVViTGoUh987pPQIoqdzB0S+M2bBiRI6Kfg=";
86 i686-windows = fetchzip {
87 url = "${base_url}Windows_i386.zip";
88 hash = "sha256-t81/wK1weZ/uEZ5TzivylARTUqks9rLIG7WzeoWXb1k=";
91 x86_64-windows = fetchzip {
92 url = "${base_url}Windows_x86_64.zip";
93 hash = "sha256-9yydDMI9Gz/OswRhJHF+2c3Ia0zDmXMbf7byj6PJe24=";
97 updateScript = writeShellScript "update-gk-cli" ''
103 common-updater-scripts
106 NEW_VERSION=$(curl --silent https://api.github.com/repos/gitkraken/gk-cli/releases/latest | jq '.tag_name | ltrimstr("v")' --raw-output)
107 if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then
108 echo "The new version same as the old version."
111 for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do
112 update-source-version "gk-cli" "$NEW_VERSION" --ignore-same-version --source-key="passthru.sources.$platform"
118 description = "CLI for Git collaboration across multiple repos and services";
119 homepage = "https://www.gitkraken.com";
120 license = lib.licenses.unfree;
121 sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
122 maintainers = [ lib.maintainers.pinage404 ];
124 platforms = builtins.attrNames finalAttrs.passthru.sources;