Compare commits
No commits in common. "a97a551be340f07ccfb958d52f4047f30b150b08" and "0e03adb60af33ebfe043d35e2661e792f72eacde" have entirely different histories.
a97a551be3
...
0e03adb60a
6 changed files with 21 additions and 118 deletions
|
@ -21,7 +21,6 @@ jobs:
|
||||||
nix-update --flake anonymous-overflow
|
nix-update --flake anonymous-overflow
|
||||||
nix-update --flake --version development bulk-downloader-for-reddit
|
nix-update --flake --version development bulk-downloader-for-reddit
|
||||||
nix-update --flake q
|
nix-update --flake q
|
||||||
env NIX_PATH=nixpkgs=$(nix flake metadata github:nixos/nixpkgs/nixos-unstable-small --json | jq -r .path) nix-shell ./packages/tabnine/update.sh
|
|
||||||
nix-update --flake vuetorrent
|
nix-update --flake vuetorrent
|
||||||
- uses: https://github.com/stefanzweifel/git-auto-commit-action@v5
|
- uses: https://github.com/stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
agilebits-op = import ./packages/agilebits-op.nix { inherit pkgs lib; };
|
agilebits-op = import ./packages/agilebits-op.nix { inherit pkgs lib; };
|
||||||
cliclick = import ./packages/cliclick.nix { inherit pkgs lib; };
|
cliclick = import ./packages/cliclick.nix { inherit pkgs lib; };
|
||||||
phantomjs = import ./packages/phantomjs.nix { inherit pkgs lib; };
|
phantomjs = import ./packages/phantomjs.nix { inherit pkgs lib; };
|
||||||
tabnine = import ./packages/tabnine { inherit pkgs lib; };
|
tabnine = import ./packages/tabnine.nix { inherit pkgs lib; };
|
||||||
} else { };
|
} else { };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
20
packages/tabnine.nix
Normal file
20
packages/tabnine.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
pkgs.tabnine.overrideAttrs (
|
||||||
|
oa: rec {
|
||||||
|
# https://update.tabnine.com/bundles/version
|
||||||
|
version = "4.53.0";
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://update.tabnine.com/bundles/${version}/aarch64-apple-darwin/TabNine.zip";
|
||||||
|
sha256 = "01c1rxf6k5wv4758g9m8n6mngp07kr8xbskb5liz1x8cljcs6f72";
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://tabnine.com";
|
||||||
|
description = "Smart Compose for code that uses deep learning to help you write code faster";
|
||||||
|
license = licenses.unfree;
|
||||||
|
platforms = [ "aarch64-darwin" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
|
@ -1,55 +0,0 @@
|
||||||
{ pkgs, lib, ... }:
|
|
||||||
|
|
||||||
# Based on: https://github.com/NixOS/nixpkgs/blob/91a00709aebb3602f172a0bf47ba1ef013e34835/pkgs/development/tools/tabnine/default.nix
|
|
||||||
|
|
||||||
let
|
|
||||||
stdenv = pkgs.stdenv;
|
|
||||||
|
|
||||||
sources = lib.importJSON ./sources.json;
|
|
||||||
|
|
||||||
platform =
|
|
||||||
if (builtins.hasAttr stdenv.hostPlatform.system sources.platforms) then
|
|
||||||
builtins.getAttr (stdenv.hostPlatform.system) sources.platforms
|
|
||||||
else
|
|
||||||
throw "Not supported on ${stdenv.hostPlatform.system}";
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "tabnine";
|
|
||||||
inherit (sources) version;
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url = "https://update.tabnine.com/bundles/${sources.version}/${platform.name}/TabNine.zip";
|
|
||||||
inherit (platform) hash;
|
|
||||||
};
|
|
||||||
|
|
||||||
dontBuild = true;
|
|
||||||
|
|
||||||
# Work around the "unpacker appears to have produced no directories"
|
|
||||||
# case that happens when the archive doesn't have a subdirectory.
|
|
||||||
sourceRoot = ".";
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgs.unzip ];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
install -Dm755 TabNine $out/bin/TabNine
|
|
||||||
install -Dm755 TabNine-deep-cloud $out/bin/TabNine-deep-cloud
|
|
||||||
install -Dm755 TabNine-deep-local $out/bin/TabNine-deep-local
|
|
||||||
install -Dm755 WD-TabNine $out/bin/WD-TabNine
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
platform = platform.name;
|
|
||||||
updateScript = ./update.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
homepage = "https://tabnine.com";
|
|
||||||
description = "Smart Compose for code that uses deep learning to help you write code faster";
|
|
||||||
license = licenses.unfree;
|
|
||||||
platforms = builtins.attrNames sources.platforms;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
"version": "4.64.0",
|
|
||||||
"platforms": {
|
|
||||||
"x86_64-linux": {
|
|
||||||
"name": "x86_64-unknown-linux-musl",
|
|
||||||
"hash": "sha256-AruVHP8UweT2zyOHphanvLFwOAsHiK/u98jL9axeQTI="
|
|
||||||
},
|
|
||||||
"aarch64-darwin": {
|
|
||||||
"name": "aarch64-apple-darwin",
|
|
||||||
"hash": "sha256-p06j62PaypAyeQEoFwntKQ6qSRT8Gi4NZ/Tqw+V4Ms4="
|
|
||||||
},
|
|
||||||
"x86_64-darwin": {
|
|
||||||
"name": "x86_64-apple-darwin",
|
|
||||||
"hash": "sha256-7wFdY0AzaHNLxlrQxfl55BWVcvGeqCa0dTM2zMgCK8Y="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
#!/usr/bin/env nix-shell
|
|
||||||
#!nix-shell -i bash -p curlMinimal jq
|
|
||||||
#shellcheck shell=bash
|
|
||||||
|
|
||||||
# Based on: https://github.com/NixOS/nixpkgs/blob/91a00709aebb3602f172a0bf47ba1ef013e34835/pkgs/development/tools/tabnine/update.sh
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
|
||||||
|
|
||||||
function prefetch-sri() {
|
|
||||||
nix-prefetch-url "$1" 2>/dev/null |
|
|
||||||
xargs nix --experimental-features nix-command hash to-sri --type sha256
|
|
||||||
}
|
|
||||||
|
|
||||||
declare -A platforms=(
|
|
||||||
[x86_64-unknown-linux-musl]="x86_64-linux"
|
|
||||||
[x86_64-apple-darwin]="x86_64-darwin"
|
|
||||||
[aarch64-apple-darwin]="aarch64-darwin"
|
|
||||||
)
|
|
||||||
|
|
||||||
old_version="$(jq -r '.version' "$SCRIPT_DIR/sources.json")"
|
|
||||||
new_version="$(curl -sS https://update.tabnine.com/bundles/version)"
|
|
||||||
|
|
||||||
echo "Updating $old_version -> $new_version"
|
|
||||||
|
|
||||||
sources_tmp="$(mktemp)"
|
|
||||||
trap 'rm -f "$sources_tmp"' EXIT
|
|
||||||
|
|
||||||
cat <<EOF >"$sources_tmp"
|
|
||||||
{
|
|
||||||
"version": "$new_version",
|
|
||||||
"platforms": {}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
for platform in "${!platforms[@]}"; do
|
|
||||||
url="https://update.tabnine.com/bundles/${new_version}/${platform}/TabNine.zip"
|
|
||||||
hash="$(prefetch-sri "$url")"
|
|
||||||
nix_platform="${platforms[$platform]}"
|
|
||||||
cat <<<"$(jq --arg nix_platform "$nix_platform" --arg platform "$platform" --arg hash "$hash" '.platforms += {($nix_platform): {name: $platform, hash: $hash}}' "$sources_tmp")" >"$sources_tmp"
|
|
||||||
done
|
|
||||||
|
|
||||||
cp "$sources_tmp" "$SCRIPT_DIR/sources.json"
|
|
Loading…
Reference in a new issue