about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsuperherointj <5861043+superherointj@users.noreply.github.com>2024-04-11 09:15:41 -0300
committersuperherointj <5861043+superherointj@users.noreply.github.com>2024-04-16 11:11:14 -0300
commit937b420b663f3ae0727f152c7b2cb2de32876aa3 (patch)
tree95b5c21cdb06f3bfd834d9e7fb1d6f3cdd15bf52
parentb6eec2f5ce4802f12f05b2fcf95e61bbe420fabf (diff)
vscode-extensions.jackmacwindows.craftos-pc: move to a directory
-rw-r--r--pkgs/applications/editors/vscode/extensions/default.nix34
-rw-r--r--pkgs/applications/editors/vscode/extensions/jackmacwindows.craftos-pc/default.nix43
2 files changed, 44 insertions, 33 deletions
diff --git a/pkgs/applications/editors/vscode/extensions/default.nix b/pkgs/applications/editors/vscode/extensions/default.nix
index fc055d569c475..dba41b89a4db1 100644
--- a/pkgs/applications/editors/vscode/extensions/default.nix
+++ b/pkgs/applications/editors/vscode/extensions/default.nix
@@ -18,7 +18,6 @@
 , racket
 , alejandra
 , millet
-, craftos-pc
 , shfmt
 , tinymist
 , typst-lsp
@@ -2273,38 +2272,7 @@ let
         };
       };
 
-      jackmacwindows.craftos-pc = buildVscodeMarketplaceExtension {
-        mktplcRef = {
-          name = "craftos-pc";
-          publisher = "jackmacwindows";
-          version = "1.2.2";
-          hash = "sha256-A+MNroXv0t9Mw/gr0Fyov3cXyF/GGzwRLKrIxQ2tKCE=";
-        };
-        nativeBuildInputs = [ jq moreutils ];
-        postInstall = ''
-          cd "$out/$installPrefix"
-
-          jq -e '
-            .contributes.configuration.properties."craftos-pc.executablePath.linux".default =
-              "${lib.meta.getExe craftos-pc}" |
-            .contributes.configuration.properties."craftos-pc.executablePath.mac".default =
-              "${lib.meta.getExe craftos-pc}" |
-            .contributes.configuration.properties."craftos-pc.executablePath.windows".default =
-              "${lib.meta.getExe craftos-pc}"
-          ' \
-          < package.json \
-          | sponge package.json
-        '';
-        meta = {
-          changelog = "https://marketplace.visualstudio.com/items/jackmacwindows.craftos-pc/changelog";
-          description = "A Visual Studio Code extension for opening a CraftOS-PC window";
-          downloadPage = "https://marketplace.visualstudio.com/items?itemName=jackmacwindows.craftos-pc";
-          homepage = "https://www.craftos-pc.cc/docs/extension";
-          license = lib.licenses.mit;
-          maintainers = with lib.maintainers; [ tomodachi94 ];
-          platforms = craftos-pc.meta.platforms;
-        };
-      };
+      jackmacwindows.craftos-pc = callPackage ./jackmacwindows.craftos-pc { };
 
       james-yu.latex-workshop = buildVscodeMarketplaceExtension {
         mktplcRef = {
diff --git a/pkgs/applications/editors/vscode/extensions/jackmacwindows.craftos-pc/default.nix b/pkgs/applications/editors/vscode/extensions/jackmacwindows.craftos-pc/default.nix
new file mode 100644
index 0000000000000..005f78f4f4ae9
--- /dev/null
+++ b/pkgs/applications/editors/vscode/extensions/jackmacwindows.craftos-pc/default.nix
@@ -0,0 +1,43 @@
+{
+  vscode-utils,
+  craftos-pc,
+  jq,
+  lib,
+  moreutils,
+}:
+
+vscode-utils.buildVscodeMarketplaceExtension {
+  mktplcRef = {
+    name = "craftos-pc";
+    publisher = "jackmacwindows";
+    version = "1.2.2";
+    hash = "sha256-A+MNroXv0t9Mw/gr0Fyov3cXyF/GGzwRLKrIxQ2tKCE=";
+  };
+  nativeBuildInputs = [
+    jq
+    moreutils
+  ];
+  postInstall = ''
+    cd "$out/$installPrefix"
+
+    jq -e '
+      .contributes.configuration.properties."craftos-pc.executablePath.linux".default =
+        "${lib.meta.getExe craftos-pc}" |
+      .contributes.configuration.properties."craftos-pc.executablePath.mac".default =
+        "${lib.meta.getExe craftos-pc}" |
+      .contributes.configuration.properties."craftos-pc.executablePath.windows".default =
+        "${lib.meta.getExe craftos-pc}"
+    ' \
+    < package.json \
+    | sponge package.json
+  '';
+  meta = {
+    changelog = "https://marketplace.visualstudio.com/items/jackmacwindows.craftos-pc/changelog";
+    description = "A Visual Studio Code extension for opening a CraftOS-PC window";
+    downloadPage = "https://marketplace.visualstudio.com/items?itemName=jackmacwindows.craftos-pc";
+    homepage = "https://www.craftos-pc.cc/docs/extension";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ tomodachi94 ];
+    platforms = craftos-pc.meta.platforms;
+  };
+}