vscode-extensions.b4dm4n.vscode-nixpkgs-fmt: add nixpkgs-fmt dependency

This commit is contained in:
happysalada 2021-06-06 16:26:06 +09:00 committed by Raphael Megzari
parent 1470b9bc18
commit 0a776e108f

View File

@ -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;
};