From 0a776e108f85d9a8e2f4c2147f6e61cf1880fe6e Mon Sep 17 00:00:00 2001 From: happysalada Date: Sun, 6 Jun 2021 16:26:06 +0900 Subject: [PATCH] vscode-extensions.b4dm4n.vscode-nixpkgs-fmt: add nixpkgs-fmt dependency --- pkgs/misc/vscode-extensions/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/misc/vscode-extensions/default.nix b/pkgs/misc/vscode-extensions/default.nix index 4e7713bdc5fd..9d21b057c8a2 100644 --- a/pkgs/misc/vscode-extensions/default.nix +++ b/pkgs/misc/vscode-extensions/default.nix @@ -1,4 +1,4 @@ -{ config, lib, buildEnv, callPackage, vscode-utils, nodePackages, jdk, llvmPackages_8 }: +{ config, lib, buildEnv, callPackage, vscode-utils, nodePackages, jdk, llvmPackages_8, nixpkgs-fmt, jq }: let inherit (vscode-utils) buildVscodeMarketplaceExtension; @@ -99,13 +99,21 @@ let }; }; - B4dM4n.vscode-nixpkgs-fmt = buildVscodeMarketplaceExtension { + b4dm4n.vscode-nixpkgs-fmt = buildVscodeMarketplaceExtension { mktplcRef = { name = "nixpkgs-fmt"; publisher = "B4dM4n"; version = "0.0.1"; sha256 = "sha256-vz2kU36B1xkLci2QwLpl/SBEhfSWltIDJ1r7SorHcr8="; }; + nativeBuildInputs = [ jq ]; + buildInputs = [ nixpkgs-fmt ]; + postInstall = '' + cd "$out/$installPrefix" + tmp_package_json=$(mktemp) + jq '.contributes.configuration.properties."nixpkgs-fmt.path".default = "${nixpkgs-fmt}/bin/nixpkgs-fmt"' package.json > "$tmp_package_json" + mv "$tmp_package_json" package.json + ''; meta = with lib; { license = licenses.mit; };