about summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorsuperherointj <5861043+superherointj@users.noreply.github.com>2024-04-11 09:44:02 -0300
committersuperherointj <5861043+superherointj@users.noreply.github.com>2024-04-16 11:13:57 -0300
commite62a408834f77e180a7131a5e497886c3426d681 (patch)
treebbf92a69dae18026128c18c7a8d0c779ca2cb9b4 /pkgs/applications/editors
parent3ac536f66b80e23dbcbf9fb93127e4cc75f57cb8 (diff)
vscode-extensions.kamadorueda.alejandra: move to a directory
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/vscode/extensions/default.nix29
-rw-r--r--pkgs/applications/editors/vscode/extensions/kamadorueda.alejandra/default.nix38
2 files changed, 39 insertions, 28 deletions
diff --git a/pkgs/applications/editors/vscode/extensions/default.nix b/pkgs/applications/editors/vscode/extensions/default.nix
index 806bfa95c1cac..9f565d5cdb0ac 100644
--- a/pkgs/applications/editors/vscode/extensions/default.nix
+++ b/pkgs/applications/editors/vscode/extensions/default.nix
@@ -14,7 +14,6 @@
 , jq
 , shellcheck
 , moreutils
-, alejandra
 , shfmt
 , typst-lsp
 , typst-preview
@@ -2428,33 +2427,7 @@ let
         };
       };
 
-      kamadorueda.alejandra = buildVscodeMarketplaceExtension {
-        mktplcRef = {
-          name = "alejandra";
-          publisher = "kamadorueda";
-          version = "1.0.0";
-          hash = "sha256-COlEjKhm8tK5XfOjrpVUDQ7x3JaOLiYoZ4MdwTL8ktk=";
-        };
-        nativeBuildInputs = [ jq moreutils ];
-        postInstall = ''
-          cd "$out/$installPrefix"
-
-          jq -e '
-            .contributes.configuration.properties."alejandra.program".default =
-              "${alejandra}/bin/alejandra" |
-            .contributes.configurationDefaults."alejandra.program" =
-              "${alejandra}/bin/alejandra"
-          ' \
-          < package.json \
-          | sponge package.json
-        '';
-        meta = {
-          description = "The Uncompromising Nix Code Formatter";
-          homepage = "https://github.com/kamadorueda/alejandra";
-          license = lib.licenses.unlicense;
-          maintainers = [ lib.maintainers.kamadorueda ];
-        };
-      };
+      kamadorueda.alejandra = callPackage ./kamadorueda.alejandra { };
 
       kamikillerto.vscode-colorize = buildVscodeMarketplaceExtension {
         mktplcRef = {
diff --git a/pkgs/applications/editors/vscode/extensions/kamadorueda.alejandra/default.nix b/pkgs/applications/editors/vscode/extensions/kamadorueda.alejandra/default.nix
new file mode 100644
index 0000000000000..a3658346147e3
--- /dev/null
+++ b/pkgs/applications/editors/vscode/extensions/kamadorueda.alejandra/default.nix
@@ -0,0 +1,38 @@
+{
+  alejandra,
+  jq,
+  lib,
+  moreutils,
+  vscode-utils,
+}:
+
+vscode-utils.buildVscodeMarketplaceExtension {
+  mktplcRef = {
+    name = "alejandra";
+    publisher = "kamadorueda";
+    version = "1.0.0";
+    hash = "sha256-COlEjKhm8tK5XfOjrpVUDQ7x3JaOLiYoZ4MdwTL8ktk=";
+  };
+  nativeBuildInputs = [
+    jq
+    moreutils
+  ];
+  postInstall = ''
+    cd "$out/$installPrefix"
+
+    jq -e '
+      .contributes.configuration.properties."alejandra.program".default =
+        "${alejandra}/bin/alejandra" |
+      .contributes.configurationDefaults."alejandra.program" =
+        "${alejandra}/bin/alejandra"
+    ' \
+    < package.json \
+    | sponge package.json
+  '';
+  meta = {
+    description = "The Uncompromising Nix Code Formatter";
+    homepage = "https://github.com/kamadorueda/alejandra";
+    license = lib.licenses.unlicense;
+    maintainers = [ lib.maintainers.kamadorueda ];
+  };
+}