about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--maintainers/maintainer-list.nix9
-rw-r--r--pkgs/applications/editors/vim/plugins/generated.nix11
-rw-r--r--pkgs/applications/editors/vim/plugins/overrides.nix8
-rw-r--r--pkgs/applications/editors/vim/plugins/vim-plugin-names1
-rw-r--r--pkgs/by-name/ta/tabby/package.nix73
5 files changed, 102 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index c01c67033aba..e25af81c96a8 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -7047,6 +7047,15 @@
     github = "ghostbuster91";
     githubId = 5662622;
   };
+  ghthor = {
+    email = "ghthor@gmail.com";
+    github = "ghthor";
+    githubId = 160298;
+    name = "Will Owens";
+    keys = [{
+      fingerprint = "8E98 BB01 BFF8 AEA4 E303  FC4C 8074 09C9 2CE2 3033";
+    }];
+  };
   ghuntley = {
     email = "ghuntley@ghuntley.com";
     github = "ghuntley";
diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix
index 57abacccd2d9..20a4184580ff 100644
--- a/pkgs/applications/editors/vim/plugins/generated.nix
+++ b/pkgs/applications/editors/vim/plugins/generated.nix
@@ -16851,5 +16851,16 @@ final: prev:
     meta.homepage = "https://github.com/jhradilek/vim-snippets/";
   };
 
+  vim-tabby = buildVimPlugin {
+    pname = "vim-tabby";
+    version = "2024-02-01";
+    src = fetchFromGitHub {
+      owner = "TabbyML";
+      repo = "vim-tabby";
+      rev = "0b62bc2ed5c7d930c7435c3504d5c18ea6379b28";
+      sha256 = "06crxhvwz04s6sfj0q22kkp3g5zvip13088m95qwznw9bv2gpx3s";
+    };
+    meta.homepage = "https://github.com/TabbyML/vim-tabby/";
+  };
 
 }
diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix
index da1b4b6bea20..ab4d9a594867 100644
--- a/pkgs/applications/editors/vim/plugins/overrides.nix
+++ b/pkgs/applications/editors/vim/plugins/overrides.nix
@@ -1671,6 +1671,14 @@
     dependencies = with self; [ vim-repeat ];
   };
 
+  vim-tabby = super.vim-tabby.overrideAttrs {
+    postPatch = ''
+      substituteInPlace autoload/tabby/globals.vim --replace-fail \
+        "let g:tabby_node_binary = get(g:, 'tabby_node_binary', 'node')" \
+        "let g:tabby_node_binary = get(g:, 'tabby_node_binary', '${nodejs}/bin/node')"
+    '';
+  };
+
   vim-textobj-entire = super.vim-textobj-entire.overrideAttrs {
     dependencies = with self; [ vim-textobj-user ];
     meta.maintainers = with lib.maintainers; [ farlion ];
diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names
index 7a316fcdfc33..8c0814d5616a 100644
--- a/pkgs/applications/editors/vim/plugins/vim-plugin-names
+++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names
@@ -1401,3 +1401,4 @@ https://github.com/ziglang/zig.vim/,,
 https://github.com/mickael-menu/zk-nvim/,HEAD,
 https://github.com/troydm/zoomwintab.vim/,,
 https://github.com/nanotee/zoxide.vim/,,
+https://github.com/TabbyML/vim-tabby/,HEAD,
diff --git a/pkgs/by-name/ta/tabby/package.nix b/pkgs/by-name/ta/tabby/package.nix
new file mode 100644
index 000000000000..b89434a8fc48
--- /dev/null
+++ b/pkgs/by-name/ta/tabby/package.nix
@@ -0,0 +1,73 @@
+{ lib
+, fetchFromGitHub
+, gcc12
+, cmake
+, git
+, openssl
+, pkg-config
+, protobuf
+, rustPlatform
+, addOpenGLRunpath
+, cudatoolkit
+, nvidia ? true
+}:
+
+rustPlatform.buildRustPackage rec {
+  version = "0.7.0";
+  pname = "tabby";
+
+  src = fetchFromGitHub {
+    owner = "TabbyML";
+    repo = "tabby";
+    rev = "v${version}";
+    hash = "sha256-BTPJWvqO4IuQAiUEER9PYfu4aQsz5RI77WsA/gQu5Jc=";
+    fetchSubmodules = true;
+  };
+
+  cargoHash = "sha256-Du0ya9J+0tz72mSid5If0VFX2lLC7YtwNQ/MALpFv2M=";
+
+  # https://github.com/TabbyML/tabby/blob/v0.7.0/.github/workflows/release.yml#L39
+  cargoBuildFlags = [
+    "--release"
+    "--package" "tabby"
+  ] ++ lib.optional nvidia [
+    "--features" "cuda"
+  ];
+
+  OPENSSL_NO_VENDOR = 1;
+
+  nativeBuildInputs = [
+    pkg-config
+    protobuf
+    git
+    cmake
+    gcc12
+
+  ] ++ lib.optional nvidia [
+    addOpenGLRunpath
+  ];
+
+  buildInputs = [ openssl ]
+    ++ lib.optional nvidia cudatoolkit
+  ;
+
+  postInstall = ''
+    ${if nvidia then ''
+    addOpenGLRunpath "$out/bin/tabby"
+    '' else ''
+    ''}
+  '';
+
+  # Fails with:
+  # file cannot create directory: /var/empty/local/lib64/cmake/Llama
+  doCheck = false;
+
+  meta = with lib; {
+    homepage = "https://github.com/TabbyML/tabby";
+    changelog = "https://github.com/TabbyML/tabby/releases/tag/v${version}";
+    description = "Self-hosted AI coding assistant";
+    mainProgram = "tabby";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ghthor ];
+  };
+}