about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsuperherointj <5861043+superherointj@users.noreply.github.com>2024-04-11 09:54:45 -0300
committersuperherointj <5861043+superherointj@users.noreply.github.com>2024-04-16 11:13:58 -0300
commit4e210b2a3b058882222f1a61c25720d02687ebdf (patch)
tree951db89ee2ee9deedd823d6526dc28e4551fcfb1
parent6badd9fe8481a31c1a8b69fe8ef99174674fa02c (diff)
vscode-extensions.mgt19937.typst-preview: move to a directory
-rw-r--r--pkgs/applications/editors/vscode/extensions/default.nix31
-rw-r--r--pkgs/applications/editors/vscode/extensions/mgt19937.typst-preview/default.nix38
2 files changed, 39 insertions, 30 deletions
diff --git a/pkgs/applications/editors/vscode/extensions/default.nix b/pkgs/applications/editors/vscode/extensions/default.nix
index 4b56f18025d3c..34de692767b0e 100644
--- a/pkgs/applications/editors/vscode/extensions/default.nix
+++ b/pkgs/applications/editors/vscode/extensions/default.nix
@@ -15,7 +15,6 @@
 , shellcheck
 , moreutils
 , typst-lsp
-, typst-preview
 , autoPatchelfHook
 , zlib
 , stdenv
@@ -2630,35 +2629,7 @@ let
         };
       };
 
-      # Keep pkgs/by-name/ty/typst-preview/package.nix in sync with this
-      # extension
-      mgt19937.typst-preview = buildVscodeMarketplaceExtension {
-        mktplcRef = {
-          name = "typst-preview";
-          publisher = "mgt19937";
-          version = "0.11.4";
-          hash = "sha256-GwlzFphZmP87pLys01+PWTv13imcdGjunCMH6atz9xs=";
-        };
-
-        buildInputs = [
-          typst-preview
-        ];
-
-        nativeBuildInputs = [ jq moreutils ];
-
-        postInstall = ''
-          cd "$out/$installPrefix"
-          jq '.contributes.configuration.properties."typst-preview.executable".default = "${lib.getExe typst-preview}"' package.json | sponge package.json
-        '';
-
-        meta = {
-          description = "Typst Preview is an extension for previewing your Typst files in vscode instantly";
-          downloadPage = "https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview";
-          homepage = "https://github.com/Enter-tainer/typst-preview-vscode";
-          license = lib.licenses.mit;
-          maintainers = [ lib.maintainers.drupol ];
-        };
-      };
+      mgt19937.typst-preview = callPackage ./mgt19937.typst-preview { };
 
       mhutchie.git-graph = buildVscodeMarketplaceExtension {
         mktplcRef = {
diff --git a/pkgs/applications/editors/vscode/extensions/mgt19937.typst-preview/default.nix b/pkgs/applications/editors/vscode/extensions/mgt19937.typst-preview/default.nix
new file mode 100644
index 0000000000000..156e35ab06a01
--- /dev/null
+++ b/pkgs/applications/editors/vscode/extensions/mgt19937.typst-preview/default.nix
@@ -0,0 +1,38 @@
+# Keep pkgs/by-name/ty/typst-preview/package.nix in sync with this extension
+
+{
+  vscode-utils,
+  lib,
+  jq,
+  moreutils,
+  typst-preview,
+}:
+
+vscode-utils.buildVscodeMarketplaceExtension {
+  mktplcRef = {
+    name = "typst-preview";
+    publisher = "mgt19937";
+    version = "0.11.4";
+    hash = "sha256-GwlzFphZmP87pLys01+PWTv13imcdGjunCMH6atz9xs=";
+  };
+
+  buildInputs = [ typst-preview ];
+
+  nativeBuildInputs = [
+    jq
+    moreutils
+  ];
+
+  postInstall = ''
+    cd "$out/$installPrefix"
+    jq '.contributes.configuration.properties."typst-preview.executable".default = "${lib.getExe typst-preview}"' package.json | sponge package.json
+  '';
+
+  meta = {
+    description = "Typst Preview is an extension for previewing your Typst files in vscode instantly";
+    downloadPage = "https://marketplace.visualstudio.com/items?itemName=mgt19937.typst-preview";
+    homepage = "https://github.com/Enter-tainer/typst-preview-vscode";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.drupol ];
+  };
+}