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-1e+TeZLSYZjlyHV+KzasysAiWREy6ayuvmllmfZ3f90=";
56 armv7l-linux = fetchzip {
57 url = "${base_url}Linux_arm7.zip";
58 hash = "sha256-phhfxDgfzHTVA5OexY6aTUNIuW/+3tn0Q2+el3Tu9Os=";
61 aarch64-linux = fetchzip {
62 url = "${base_url}Linux_arm64.zip";
63 hash = "sha256-VvhbgvxCZBeJVYjjM/n6vr+xzQdolkZngzaU4Te3DbI=";
66 x86_32-linux = fetchzip {
67 url = "${base_url}Linux_i386.zip";
68 hash = "sha256-pTUNXRqWKPyyKMzJl+pIStVKpepcSX1ZdAxN39q2eZc=";
71 x86_64-linux = fetchzip {
72 url = "${base_url}Linux_x86_64.zip";
73 hash = "sha256-bs/p15HaWV+XWuERmmih9n2lhI0OZivu97gnFiMCrzQ=";
76 aarch64-darwin = fetchzip {
77 url = "${base_url}macOS_arm64.zip";
78 hash = "sha256-BD9hefbkXbNzjdeoOqQ4RMgzIXdBt/3z1T0H55sTsP0=";
81 x86_64-darwin = fetchzip {
82 url = "${base_url}macOS_x86_64.zip";
83 hash = "sha256-6L0eghJwCLZKDh2G/IKv9g1whSWLQbpj+AozumUkm2M=";
86 i686-windows = fetchzip {
87 url = "${base_url}Windows_i386.zip";
88 hash = "sha256-ZxTOhJbPUjIoDwWIHrEKBBAd3LedJRwoolSZi0h79k8=";
91 x86_64-windows = fetchzip {
92 url = "${base_url}Windows_x86_64.zip";
93 hash = "sha256-DWBzXQj1+/PKQzvI/R7gkLQz0rLz2h9x+nkPOXOtcyk=";
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;