about summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2024-05-04 22:31:45 +0200
committerPol Dellaiera <pol.dellaiera@protonmail.com>2024-05-04 23:00:26 +0200
commite94ecdea5ac786fd0447c5b1c5fa8744d382db6d (patch)
tree483b163f0b4ed232c889fbbdf9d53ac0456b239d /pkgs/applications/editors
parenta1fd087b05f9061cb75d8e912d9cc879bb24ee2b (diff)
vscode-extensions.tekumara.typos-vscode: init at 0.1.18
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/vscode/extensions/default.nix2
-rw-r--r--pkgs/applications/editors/vscode/extensions/tekumara.typos-vscode/default.nix64
2 files changed, 66 insertions, 0 deletions
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 ];
+  };
+}