diff --git a/pkgs/by-name/de/devin-cli/package.nix b/pkgs/by-name/de/devin-cli/package.nix new file mode 100644 index 000000000000..e7981aa381a4 --- /dev/null +++ b/pkgs/by-name/de/devin-cli/package.nix @@ -0,0 +1,90 @@ +{ + lib, + stdenvNoCC, + fetchurl, + installShellFiles, + versionCheckHook, +}: + +let + version = "2026.5.6-8"; + + throwSystem = throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}"; + + srcs = { + x86_64-linux = fetchurl { + url = "https://static.devin.ai/cli/${version}/devin-${version}-x86_64-unknown-linux.tar.gz"; + hash = "sha256-kBHRIUiMwbFIGRCkNIOSST6fwEULs8yJu3cwHq2eyac="; + }; + + aarch64-linux = fetchurl { + url = "https://static.devin.ai/cli/${version}/devin-${version}-aarch64-unknown-linux.tar.gz"; + hash = "sha256-3Kg90ec9Fdne/+OhfFV24JCoDWzwilrej3vRM52XRqI="; + }; + + aarch64-darwin = fetchurl { + url = "https://static.devin.ai/cli/${version}/devin-${version}-aarch64-apple-darwin.tar.gz"; + hash = "sha256-nUb8yotP9cUrWeDw5kb+ZLZ5Ug2l7QTO6eQnYNaD9o4="; + }; + + x86_64-darwin = fetchurl { + url = "https://static.devin.ai/cli/${version}/devin-${version}-x86_64-apple-darwin.tar.gz"; + hash = "sha256-CN03ZsVb1gyvFqAcVnjpT4VHB/mxnAQ2PhG8PwRZSrw="; + }; + }; + + src = srcs.${stdenvNoCC.hostPlatform.system} or throwSystem; +in + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "devin-cli"; + inherit version; + + outputs = [ + "out" + "man" + "doc" + ]; + + strictDeps = true; + __structuredAttrs = true; + + inherit src; + + sourceRoot = "."; + + nativeBuildInputs = [ installShellFiles ]; + + dontConfigure = true; + dontStrip = true; + dontBuild = true; + + doCheck = true; + + installPhase = '' + runHook preInstall + + installBin ./bin/devin + installManPage ./share/man/man1/*.1 + + mkdir -p $out/share/doc + + mv ./share/devin/docs/* $out/share/doc + + runHook postInstall + ''; + + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + passthru.updateScript = ./update.sh; + + meta = { + description = "Cognition's Devin Agent CLI"; + homepage = "https://devin.ai/"; + license = lib.licenses.unfree; + sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; + maintainers = with lib.maintainers; [ ethancedwards8 ]; + mainProgram = "devin"; + }; +}) diff --git a/pkgs/by-name/de/devin-cli/update.sh b/pkgs/by-name/de/devin-cli/update.sh new file mode 100755 index 000000000000..58a20b17911b --- /dev/null +++ b/pkgs/by-name/de/devin-cli/update.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p bash nix-update common-updater-scripts nix jq + +set -euo pipefail + +currentVersion=$(nix-instantiate --eval -E "with import ./. {}; devin-cli.version or (lib.getVersion devin-cli)" | tr -d '"') +latestVersion=$(curl https://static.devin.ai/cli/current/manifest.json | jq '.version' | tr -d '"') + +if [[ "$currentVersion" == "$latestVersion" ]]; then + echo "package is up-to-date: $currentVersion" + exit 0 +fi + +update-source-version devin-cli $latestVersion || true + +for system in \ + x86_64-linux \ + aarch64-linux \ + x86_64-darwin \ + aarch64-darwin; do + hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; devin-cli.src.url" --system "$system" | tr -d '"'))) + update-source-version devin-cli $latestVersion $hash --system=$system --ignore-same-version +done