about summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2024-05-05 14:20:07 +0200
committerJan Tojnar <jtojnar@gmail.com>2024-05-05 14:50:32 +0200
commit100509c030faf7cca1582c5a7197b8d3a815d600 (patch)
treed55f8944fd90a3dd0d86e0f495f3d0bbdf795060 /pkgs/applications/editors
parent5434ca3ba0d0db2de14cfb9a0818ea8718f696ad (diff)
parent5dc079ed333c755fe000f2b86e97bf11f6f069a4 (diff)
Merge branch 'staging-next' into staging
Conflicts in luaPackages.luarocks-nix:

- 8b563cd9f923cdf009b3864a358d912103703320 switched to the new version format (prefixed by 0 since there was no relevant last tag in the branch).
  bc4f6fa54321533b250984f7b3813f8d343dfde1 bumped version and switched to the new version format. But the tag used is not part of the branch the commit comes from (master).

  Used the new version but replaced the tag prefix with 0.

- b73ec84b9eed8de7e9095e779ee3d4066ceb091e removed meta (it is already set in the overridden luarocks). But that would cause the update script to try to update the overridden luarocks (as did the previously used old.meta).
  bf311d950e4c5d65fae66717c7c3d4f085ff6415 modified meta to fix the update script properly.

  Kept the meta from the latter since it allows update script to work.
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/neovim/default.nix209
-rw-r--r--pkgs/applications/editors/neovim/neovide/default.nix119
-rw-r--r--pkgs/applications/editors/neovim/neovide/skia-externals.json37
-rw-r--r--pkgs/applications/editors/neovim/system_rplugin_manifest.patch29
-rw-r--r--pkgs/applications/editors/neovim/treesitter-parsers.nix24
-rwxr-xr-xpkgs/applications/editors/neovim/update-treesitter-parsers.py46
-rw-r--r--pkgs/applications/editors/vim/plugins/overrides.nix6
-rw-r--r--pkgs/applications/editors/vscode/extensions/default.nix2
-rw-r--r--pkgs/applications/editors/vscode/extensions/tekumara.typos-vscode/default.nix64
9 files changed, 69 insertions, 467 deletions
diff --git a/pkgs/applications/editors/neovim/default.nix b/pkgs/applications/editors/neovim/default.nix
deleted file mode 100644
index 0dd8ca8a0877b..0000000000000
--- a/pkgs/applications/editors/neovim/default.nix
+++ /dev/null
@@ -1,209 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, removeReferencesTo, cmake, gettext, msgpack-c, libtermkey, libiconv
-, libuv, lua, ncurses, pkg-config
-, unibilium, gperf
-, libvterm-neovim
-, tree-sitter
-, fetchurl
-, buildPackages
-, treesitter-parsers ? import ./treesitter-parsers.nix { inherit fetchurl; }
-, CoreServices
-, fixDarwinDylibNames
-, glibcLocales ? null, procps ? null
-
-# now defaults to false because some tests can be flaky (clipboard etc), see
-# also: https://github.com/neovim/neovim/issues/16233
-, nodejs ? null, fish ? null, python3 ? null
-}:
-stdenv.mkDerivation (finalAttrs:
-  let
-  nvim-lpeg-dylib = luapkgs: if stdenv.isDarwin
-    then (luapkgs.lpeg.overrideAttrs (oa: {
-      preConfigure = ''
-        # neovim wants clang .dylib
-        sed -i makefile -e "s/CC = gcc/CC = clang/"
-        sed -i makefile -e "s/-bundle/-dynamiclib/"
-      '';
-      preBuild = ''
-        # there seems to be implicit calls to Makefile from luarocks, we need to
-        # add a stage to build our dylib
-        make macosx
-        mkdir -p $out/lib
-        mv lpeg.so $out/lib/lpeg.dylib
-      '';
-      nativeBuildInputs =
-        oa.nativeBuildInputs
-        ++ (
-          lib.optional stdenv.isDarwin fixDarwinDylibNames
-        );
-    }))
-    else luapkgs.lpeg;
-  requiredLuaPkgs = ps: (with ps; [
-    (nvim-lpeg-dylib ps)
-    luabitop
-    mpack
-  ] ++ lib.optionals finalAttrs.doCheck [
-    luv
-    coxpcall
-    busted
-    luafilesystem
-    penlight
-    inspect
-  ]
-  );
-  neovimLuaEnv = lua.withPackages requiredLuaPkgs;
-  neovimLuaEnvOnBuild = lua.luaOnBuild.withPackages requiredLuaPkgs;
-  codegenLua =
-    if lua.luaOnBuild.pkgs.isLuaJIT
-      then
-        let deterministicLuajit =
-          lua.luaOnBuild.override {
-            deterministicStringIds = true;
-            self = deterministicLuajit;
-          };
-        in deterministicLuajit.withPackages(ps: [ ps.mpack (nvim-lpeg-dylib ps) ])
-      else lua.luaOnBuild;
-
-
-in {
-    pname = "neovim-unwrapped";
-    version = "0.9.5";
-
-    __structuredAttrs = true;
-
-    src = fetchFromGitHub {
-      owner = "neovim";
-      repo = "neovim";
-      rev = "v${finalAttrs.version}";
-      hash = "sha256-CcaBqA0yFCffNPmXOJTo8c9v1jrEBiqAl8CG5Dj5YxE=";
-    };
-
-    patches = [
-      # introduce a system-wide rplugin.vim in addition to the user one
-      # necessary so that nix can handle `UpdateRemotePlugins` for the plugins
-      # it installs. See https://github.com/neovim/neovim/issues/9413.
-      ./system_rplugin_manifest.patch
-    ];
-
-    dontFixCmake = true;
-
-    inherit lua treesitter-parsers;
-
-    buildInputs = [
-      gperf
-      libtermkey
-      libuv
-      libvterm-neovim
-      # This is actually a c library, hence it's not included in neovimLuaEnv,
-      # see:
-      # https://github.com/luarocks/luarocks/issues/1402#issuecomment-1080616570
-      # and it's definition at: pkgs/development/lua-modules/overrides.nix
-      lua.pkgs.libluv
-      msgpack-c
-      ncurses
-      neovimLuaEnv
-      tree-sitter
-      unibilium
-    ] ++ lib.optionals stdenv.isDarwin [ libiconv CoreServices ]
-      ++ lib.optionals finalAttrs.doCheck [ glibcLocales procps ]
-    ;
-
-    doCheck = false;
-
-    # to be exhaustive, one could run
-    # make oldtests too
-    checkPhase = ''
-      runHook preCheck
-      make functionaltest
-      runHook postCheck
-    '';
-
-    nativeBuildInputs = [
-      cmake
-      gettext
-      pkg-config
-      removeReferencesTo
-    ];
-
-    # extra programs test via `make functionaltest`
-    nativeCheckInputs = let
-      pyEnv = python3.withPackages(ps: with ps; [ pynvim msgpack ]);
-    in [
-      fish
-      nodejs
-      pyEnv      # for src/clint.py
-    ];
-
-    # nvim --version output retains compilation flags and references to build tools
-    postPatch = ''
-      substituteInPlace src/nvim/version.c --replace NVIM_VERSION_CFLAGS "";
-    '' + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
-      sed -i runtime/CMakeLists.txt \
-        -e "s|\".*/bin/nvim|\${stdenv.hostPlatform.emulator buildPackages} &|g"
-      sed -i src/nvim/po/CMakeLists.txt \
-        -e "s|\$<TARGET_FILE:nvim|\${stdenv.hostPlatform.emulator buildPackages} &|g"
-    '';
-    postInstall = ''
-      find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' +
-    '';
-    # check that the above patching actually works
-    disallowedRequisites = [ stdenv.cc ] ++ lib.optional (lua != codegenLua) codegenLua;
-
-    cmakeFlagsArray = [
-      # Don't use downloaded dependencies. At the end of the configurePhase one
-      # can spot that cmake says this option was "not used by the project".
-      # That's because all dependencies were found and
-      # third-party/CMakeLists.txt is not read at all.
-      "-DUSE_BUNDLED=OFF"
-    ]
-    ++ lib.optional (!lua.pkgs.isLuaJIT) "-DPREFER_LUA=ON"
-    ;
-
-    preConfigure = lib.optionalString lua.pkgs.isLuaJIT ''
-      cmakeFlagsArray+=(
-        "-DLUAC_PRG=${codegenLua}/bin/luajit -b -s %s -"
-        "-DLUA_GEN_PRG=${codegenLua}/bin/luajit"
-        "-DLUA_PRG=${neovimLuaEnvOnBuild}/bin/luajit"
-      )
-    '' + lib.optionalString stdenv.isDarwin ''
-      substituteInPlace src/nvim/CMakeLists.txt --replace "    util" ""
-    '' + ''
-      mkdir -p $out/lib/nvim/parser
-    '' + lib.concatStrings (lib.mapAttrsToList
-      (language: src: ''
-        ln -s \
-          ${tree-sitter.buildGrammar {
-            inherit language src;
-            version = "neovim-${finalAttrs.version}";
-          }}/parser \
-          $out/lib/nvim/parser/${language}.so
-      '')
-      finalAttrs.treesitter-parsers);
-
-    shellHook=''
-      export VIMRUNTIME=$PWD/runtime
-    '';
-
-    separateDebugInfo = true;
-
-    meta = with lib; {
-      description = "Vim text editor fork focused on extensibility and agility";
-      longDescription = ''
-        Neovim is a project that seeks to aggressively refactor Vim in order to:
-        - Simplify maintenance and encourage contributions
-        - Split the work between multiple developers
-        - Enable the implementation of new/modern user interfaces without any
-          modifications to the core source
-        - Improve extensibility with a new plugin architecture
-      '';
-      homepage    = "https://www.neovim.io";
-      mainProgram = "nvim";
-      # "Contributions committed before b17d96 by authors who did not sign the
-      # Contributor License Agreement (CLA) remain under the Vim license.
-      # Contributions committed after b17d96 are licensed under Apache 2.0 unless
-      # those contributions were copied from Vim (identified in the commit logs
-      # by the vim-patch token). See LICENSE for details."
-      license = with licenses; [ asl20 vim ];
-      maintainers = with maintainers; [ manveru rvolosatovs ];
-      platforms   = platforms.unix;
-    };
-  })
diff --git a/pkgs/applications/editors/neovim/neovide/default.nix b/pkgs/applications/editors/neovim/neovide/default.nix
deleted file mode 100644
index ce9b091add820..0000000000000
--- a/pkgs/applications/editors/neovim/neovide/default.nix
+++ /dev/null
@@ -1,119 +0,0 @@
-{ lib
-, rustPlatform
-, clangStdenv
-, fetchFromGitHub
-, linkFarm
-, fetchgit
-, runCommand
-, gn
-, neovim
-, ninja
-, makeWrapper
-, pkg-config
-, python3
-, removeReferencesTo
-, xcbuild
-, SDL2
-, fontconfig
-, xorg
-, stdenv
-, darwin
-, libglvnd
-, libxkbcommon
-, enableWayland ? stdenv.isLinux
-, wayland
-}:
-
-rustPlatform.buildRustPackage.override { stdenv = clangStdenv; } rec {
-  pname = "neovide";
-  version = "0.12.2";
-
-  src = fetchFromGitHub {
-    owner = "neovide";
-    repo = "neovide";
-    rev = version;
-    sha256 = "sha256-M19LKNjUmC0WkVGm4t7vjxgMMe0FdMTmB1mLcG33OUg=";
-  };
-
-  cargoHash = "sha256-2fPprZVT7V+Ot8aCpWj6WTdyFylmzlujFdTJCrtE0rk=";
-
-  SKIA_SOURCE_DIR =
-    let
-      repo = fetchFromGitHub {
-        owner = "rust-skia";
-        repo = "skia";
-        # see rust-skia:skia-bindings/Cargo.toml#package.metadata skia
-        rev = "m119-0.67.3";
-        sha256 = "sha256-U75NuJnQa5+SNlOrsBmdlvflGdjo3el63EeIsbnE7ms=";
-      };
-      # The externals for skia are taken from skia/DEPS
-      externals = linkFarm "skia-externals" (lib.mapAttrsToList
-        (name: value: { inherit name; path = fetchgit value; })
-        (lib.importJSON ./skia-externals.json));
-    in
-    runCommand "source" { } ''
-      cp -R ${repo} $out
-      chmod -R +w $out
-      ln -s ${externals} $out/third_party/externals
-    ''
-  ;
-
-  SKIA_GN_COMMAND = "${gn}/bin/gn";
-  SKIA_NINJA_COMMAND = "${ninja}/bin/ninja";
-
-  nativeBuildInputs = [
-    makeWrapper
-    pkg-config
-    python3 # skia
-    removeReferencesTo
-  ] ++ lib.optionals stdenv.isDarwin [ xcbuild ];
-
-  nativeCheckInputs = [ neovim ];
-
-  buildInputs = [
-    SDL2
-    fontconfig
-    rustPlatform.bindgenHook
-  ] ++ lib.optionals stdenv.isDarwin [
-    darwin.apple_sdk.frameworks.AppKit
-  ];
-
-  postFixup = let
-    libPath = lib.makeLibraryPath ([
-      libglvnd
-      libxkbcommon
-      xorg.libXcursor
-      xorg.libXext
-      xorg.libXrandr
-      xorg.libXi
-    ] ++ lib.optionals enableWayland [ wayland ]);
-  in ''
-      # library skia embeds the path to its sources
-      remove-references-to -t "$SKIA_SOURCE_DIR" \
-        $out/bin/neovide
-
-      wrapProgram $out/bin/neovide \
-        --prefix LD_LIBRARY_PATH : ${libPath}
-    '';
-
-  postInstall = ''
-    for n in 16x16 32x32 48x48 256x256; do
-      install -m444 -D "assets/neovide-$n.png" \
-        "$out/share/icons/hicolor/$n/apps/neovide.png"
-    done
-    install -m444 -Dt $out/share/icons/hicolor/scalable/apps assets/neovide.svg
-    install -m444 -Dt $out/share/applications assets/neovide.desktop
-  '';
-
-  disallowedReferences = [ SKIA_SOURCE_DIR ];
-
-  meta = with lib; {
-    description = "This is a simple graphical user interface for Neovim.";
-    mainProgram = "neovide";
-    homepage = "https://github.com/neovide/neovide";
-    changelog = "https://github.com/neovide/neovide/releases/tag/${version}";
-    license = with licenses; [ mit ];
-    maintainers = with maintainers; [ ck3d ];
-    platforms = platforms.all;
-  };
-}
diff --git a/pkgs/applications/editors/neovim/neovide/skia-externals.json b/pkgs/applications/editors/neovim/neovide/skia-externals.json
deleted file mode 100644
index e57814e2a2d87..0000000000000
--- a/pkgs/applications/editors/neovim/neovide/skia-externals.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
-  "expat": {
-    "url": "https://chromium.googlesource.com/external/github.com/libexpat/libexpat.git",
-    "rev": "441f98d02deafd9b090aea568282b28f66a50e36",
-    "sha256": "sha256-FXTDGAK03jc2wvazhRKqtsFRKZUYS/9HLpZNp4JfZJI="
-  },
-  "libjpeg-turbo": {
-    "url": "https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git",
-    "rev": "ed683925e4897a84b3bffc5c1414c85b97a129a3",
-    "sha256": "sha256-DYJP3phe4OzCtRN2pMc07ITTWR8MuIlOWWg9PBsQAVw="
-  },
-  "icu": {
-    "url": "https://chromium.googlesource.com/chromium/deps/icu.git",
-    "rev": "a0718d4f121727e30b8d52c7a189ebf5ab52421f",
-    "sha256": "sha256-BI3f/gf9GNDvSfXWeRHKBvznSz4mjXY8rM24kK7QvOM="
-  },
-  "zlib": {
-    "url": "https://chromium.googlesource.com/chromium/src/third_party/zlib",
-    "rev": "c876c8f87101c5a75f6014b0f832499afeb65b73",
-    "sha256": "sha256-mwozVo8ymyrYN4tw+/ZnSI+xogSTZQ6PUBba/jQqRkE="
-  },
-  "harfbuzz": {
-    "url": "https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git",
-    "rev": "4cfc6d8e173e800df086d7be078da2e8c5cfca19",
-    "sha256": "sha256-rrstyAz7Eb8ZgFJZKUASY8nU4YFZAptd5VS9B2cs2Yg="
-  },
-  "wuffs": {
-    "url": "https://skia.googlesource.com/external/github.com/google/wuffs-mirror-release-c.git",
-    "rev": "e3f919ccfe3ef542cfc983a82146070258fb57f8",
-    "sha256": "sha256-373d2F/STcgCHEq+PO+SCHrKVOo6uO1rqqwRN5eeBCw="
-  },
-  "libpng": {
-    "url": "https://skia.googlesource.com/third_party/libpng.git",
-    "rev": "386707c6d19b974ca2e3db7f5c61873813c6fe44",
-    "sha256": "sha256-67kf5MBsnBBi0bOfX/RKL52xpaCWm/ampltAI+EeQ+c="
-  }
-}
diff --git a/pkgs/applications/editors/neovim/system_rplugin_manifest.patch b/pkgs/applications/editors/neovim/system_rplugin_manifest.patch
deleted file mode 100644
index f634d3ec056a2..0000000000000
--- a/pkgs/applications/editors/neovim/system_rplugin_manifest.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff --git a/runtime/autoload/remote/host.vim b/runtime/autoload/remote/host.vim
-index 6266b312b..965fabf1e 100644
---- a/runtime/autoload/remote/host.vim
-+++ b/runtime/autoload/remote/host.vim
-@@ -71,7 +71,8 @@ function! remote#host#RegisterPlugin(host, path, specs) abort
- 
-   for plugin in plugins
-     if plugin.path == a:path
--      throw 'Plugin "'.a:path.'" is already registered'
-+      " plugin already registered
-+      return
-     endif
-   endfor
- 
-diff --git a/runtime/plugin/rplugin.vim b/runtime/plugin/rplugin.vim
-index 122d8d47f..83fbf8b57 100644
---- a/runtime/plugin/rplugin.vim
-+++ b/runtime/plugin/rplugin.vim
-@@ -54,6 +54,10 @@ function! s:GetManifest() abort
- endfunction
- 
- function! s:LoadRemotePlugins() abort
-+  if exists('$NVIM_SYSTEM_RPLUGIN_MANIFEST')
-+    let g:system_remote_plugins = fnamemodify($NVIM_SYSTEM_RPLUGIN_MANIFEST, ':p')
-+    execute 'source' fnameescape(g:system_remote_plugins)
-+  endif
-   let g:loaded_remote_plugins = s:GetManifest()
-   if filereadable(g:loaded_remote_plugins)
-     execute 'source' fnameescape(g:loaded_remote_plugins)
diff --git a/pkgs/applications/editors/neovim/treesitter-parsers.nix b/pkgs/applications/editors/neovim/treesitter-parsers.nix
deleted file mode 100644
index d36f8bda85429..0000000000000
--- a/pkgs/applications/editors/neovim/treesitter-parsers.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ fetchurl }:
-
-{
-  c = fetchurl {
-    url = "https://github.com/tree-sitter/tree-sitter-c/archive/v0.20.2.tar.gz";
-    hash = "sha256:af66fde03feb0df4faf03750102a0d265b007e5d957057b6b293c13116a70af2";
-  };
-  lua = fetchurl {
-    url = "https://github.com/MunifTanjim/tree-sitter-lua/archive/v0.0.14.tar.gz";
-    hash = "sha256:930d0370dc15b66389869355c8e14305b9ba7aafd36edbfdb468c8023395016d";
-  };
-  vim = fetchurl {
-    url = "https://github.com/neovim/tree-sitter-vim/archive/v0.3.0.tar.gz";
-    hash = "sha256:403acec3efb7cdb18ff3d68640fc823502a4ffcdfbb71cec3f98aa786c21cbe2";
-  };
-  vimdoc = fetchurl {
-    url = "https://github.com/neovim/tree-sitter-vimdoc/archive/v2.0.0.tar.gz";
-    hash = "sha256:1ff8f4afd3a9599dd4c3ce87c155660b078c1229704d1a254433e33794b8f274";
-  };
-  query = fetchurl {
-    url = "https://github.com/nvim-treesitter/tree-sitter-query/archive/v0.1.0.tar.gz";
-    hash = "sha256:e2b806f80e8bf1c4f4e5a96248393fe6622fc1fc6189d6896d269658f67f914c";
-  };
-}
diff --git a/pkgs/applications/editors/neovim/update-treesitter-parsers.py b/pkgs/applications/editors/neovim/update-treesitter-parsers.py
deleted file mode 100755
index 27260ca649172..0000000000000
--- a/pkgs/applications/editors/neovim/update-treesitter-parsers.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env nix-shell
-#!nix-shell -i python3 -p python3
-
-import re
-import subprocess
-from pathlib import Path
-
-parsers = {}
-dir = Path(__file__).parent
-regex = re.compile(r"^set\(TREESITTER_([A-Z_]+)_(URL|SHA256)\s+([^ \)]+)\s*\)\s*$")
-
-src = subprocess.check_output(
-    [
-        "nix-build",
-        dir.parent.parent.parent.parent,
-        "-A",
-        "neovim-unwrapped.src",
-        "--no-out-link",
-    ],
-    text=True,
-).strip()
-
-for line in open(f"{src}/cmake.deps/CMakeLists.txt"):
-    m = regex.fullmatch(line)
-    if m is None:
-        continue
-
-    lang = m[1].lower()
-    ty = m[2]
-    val = m[3]
-
-    if not lang in parsers:
-        parsers[lang] = {}
-    parsers[lang][ty] = val
-
-with open(dir / "treesitter-parsers.nix", "w") as f:
-    f.write("{ fetchurl }:\n\n{\n")
-    for lang, src in parsers.items():
-        f.write(
-            f"""  {lang} = fetchurl {{
-    url = "{src["URL"]}";
-    hash = "sha256:{src["SHA256"]}";
-  }};
-"""
-        )
-    f.write("}\n")
diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix
index 0b17b14b7deae..79153066705bf 100644
--- a/pkgs/applications/editors/vim/plugins/overrides.nix
+++ b/pkgs/applications/editors/vim/plugins/overrides.nix
@@ -1240,12 +1240,12 @@
 
   sniprun =
     let
-      version = "1.3.12";
+      version = "1.3.13";
       src = fetchFromGitHub {
         owner = "michaelb";
         repo = "sniprun";
         rev = "refs/tags/v${version}";
-        hash = "sha256-siM0MBugee2OVaD1alr2hKn9ngoaV3Iy9No/F3wryJs=";
+        hash = "sha256-PQ3nAZ+bMbHHJWD7cV6h1b3g3TzrakA/N8vVumIooMg=";
       };
       sniprun-bin = rustPlatform.buildRustPackage {
         pname = "sniprun-bin";
@@ -1255,7 +1255,7 @@
           darwin.apple_sdk.frameworks.Security
         ];
 
-        cargoHash = "sha256-Gnpv0vAU3kTtCKsV2XGlSbzYuHEqR7iDFeKj9Vhq1UQ=";
+        cargoHash = "sha256-I8R2V9zoLqiM4lu0D7URoVof68wtKHI+8T8fVrUg7i4=";
 
         nativeBuildInputs = [ makeWrapper ];
 
diff --git a/pkgs/applications/editors/vscode/extensions/default.nix b/pkgs/applications/editors/vscode/extensions/default.nix
index 27bce5cd2abfa..854eb94ad0a55 100644
--- a/pkgs/applications/editors/vscode/extensions/default.nix
+++ b/pkgs/applications/editors/vscode/extensions/default.nix
@@ -4094,6 +4094,8 @@ let
         };
       };
 
+      tekumara.typos-vscode = callPackage ./tekumara.typos-vscode { };
+
       theangryepicbanana.language-pascal = buildVscodeMarketplaceExtension {
         mktplcRef = {
           name = "language-pascal";
diff --git a/pkgs/applications/editors/vscode/extensions/tekumara.typos-vscode/default.nix b/pkgs/applications/editors/vscode/extensions/tekumara.typos-vscode/default.nix
new file mode 100644
index 0000000000000..140a371efd456
--- /dev/null
+++ b/pkgs/applications/editors/vscode/extensions/tekumara.typos-vscode/default.nix
@@ -0,0 +1,64 @@
+{
+  stdenv,
+  jq,
+  lib,
+  moreutils,
+  typos-lsp,
+  vscode-utils,
+}:
+let
+  inherit (stdenv.hostPlatform) system;
+
+  extInfo =
+    {
+      x86_64-linux = {
+        arch = "linux-x64";
+        hash = "sha256-CPUlJ1QzGiZKd4r46Iioc5svw0oLsMsYnc0KxT1p0zM=";
+      };
+      aarch64-linux = {
+        arch = "linux-arm64";
+        hash = "sha256-qSTCZHL7nfB300qwuqgl/4u+SYNMA2BFCrD+yQEgN/c=";
+      };
+      x86_64-darwin = {
+        arch = "darwin-x64";
+        hash = "sha256-FcZH2bB5B3wnu6F76kGp9FBdD3yZtr57TQ5xaUfRcmY=";
+      };
+      aarch64-darwin = {
+        arch = "darwin-arm64";
+        hash = "sha256-3HdK4x2WNdb9Zxqjtn9lmbgrMOzz14rH0ZF0x9B0BHY=";
+      };
+    }
+    .${system} or (throw "Unsupported system: ${system}");
+in
+vscode-utils.buildVscodeMarketplaceExtension {
+  mktplcRef = {
+    name = "typos-vscode";
+    publisher = "tekumara";
+    # Please update the corresponding binary (typos-lsp)
+    # when updating this extension.
+    # See pkgs/by-name/ty/typos-lsp/package.nix
+    version = "0.1.18";
+    inherit (extInfo) hash arch;
+  };
+
+  nativeBuildInputs = [
+    jq
+    moreutils
+  ];
+
+  buildInputs = [ typos-lsp ];
+
+  postInstall = ''
+    cd "$out/$installPrefix"
+    jq '.contributes.configuration.properties."typos.path".default = "${lib.getExe typos-lsp}"' package.json | sponge package.json
+  '';
+
+  meta = {
+    changelog = "https://marketplace.visualstudio.com/items/tekumara.typos-vscode/changelog";
+    description = "A VSCode extension for providing a low false-positive source code spell checker";
+    downloadPage = "https://marketplace.visualstudio.com/items?itemName=tekumara.typos-vscode";
+    homepage = "https://github.com/tekumara/typos-lsp";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.drupol ];
+  };
+}