diff options
author | Yt <raphael@megzari.com> | 2024-02-29 21:46:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-29 21:46:32 +0000 |
commit | 6d71a969473838cfaaea19b9c2601856fa62979e (patch) | |
tree | b0725c1d3b6ce919a51b499384111af7b41e9425 /pkgs | |
parent | 063bbe0b3d410a481dd7b202eb24918f20693561 (diff) | |
parent | bc8f5cf31a4429ffe6de93e5c14d8cb992f9975b (diff) |
Merge pull request #291744 from ghthor/upstream-tabby
tabby: init at 0.7.0 take 2
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/applications/editors/vim/plugins/generated.nix | 11 | ||||
-rw-r--r-- | pkgs/applications/editors/vim/plugins/overrides.nix | 8 | ||||
-rw-r--r-- | pkgs/applications/editors/vim/plugins/vim-plugin-names | 1 | ||||
-rw-r--r-- | pkgs/by-name/ta/tabby/package.nix | 73 |
4 files changed, 93 insertions, 0 deletions
diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix index 57abacccd2d92..20a4184580ff8 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 da1b4b6bea203..ab4d9a5948676 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 7a316fcdfc339..8c0814d5616a9 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 0000000000000..b89434a8fc48d --- /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 ]; + }; +} |