mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-28 10:50:15 +00:00
91 lines
2.2 KiB
Nix
91 lines
2.2 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
fetchNpmDeps,
|
|
libsecret,
|
|
nodejs-slim,
|
|
npmHooks,
|
|
pkg-config,
|
|
clang_20,
|
|
vscode-utils,
|
|
nix-update-script,
|
|
}:
|
|
|
|
let
|
|
vsix = stdenv.mkDerivation (finalAttrs: {
|
|
name = "prettier-vscode-${finalAttrs.version}.vsix";
|
|
pname = "prettier-vscode-vsix";
|
|
version = "12.4.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "prettier";
|
|
repo = "prettier-vscode";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-N++WB0CvqYQTRg3SQFf9QJrwSJXtUd7z/kvWXQqOSC4=";
|
|
};
|
|
|
|
npmDeps = fetchNpmDeps {
|
|
name = "${finalAttrs.pname}-npm-deps";
|
|
inherit (finalAttrs) src;
|
|
hash = "sha256-vktxhQA2a+D9Nr4vhbmGCnNdGzt0U89K50g0SgiV5SE=";
|
|
};
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
|
|
libsecret
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
nodejs-slim
|
|
nodejs-slim.npm
|
|
nodejs-slim.python
|
|
npmHooks.npmConfigHook
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
pkg-config
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
clang_20 # clang_21 breaks @vscode/vsce's optional dependency keytar
|
|
];
|
|
|
|
strictDeps = true;
|
|
|
|
env.PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1";
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
|
|
node --run compile
|
|
npx @vscode/vsce package --out $out
|
|
|
|
runHook postBuild
|
|
'';
|
|
});
|
|
in
|
|
vscode-utils.buildVscodeExtension (finalAttrs: {
|
|
pname = "prettier-vscode";
|
|
inherit (finalAttrs.src) version;
|
|
|
|
vscodeExtPublisher = "prettier";
|
|
vscodeExtName = "prettier-vscode";
|
|
vscodeExtUniqueId = "${finalAttrs.vscodeExtPublisher}.${finalAttrs.vscodeExtName}";
|
|
|
|
src = vsix;
|
|
|
|
passthru = {
|
|
vsix = finalAttrs.src;
|
|
updateScript = nix-update-script {
|
|
attrPath = "vscode-extensions.prettier.prettier-vscode.vsix";
|
|
};
|
|
};
|
|
|
|
meta = {
|
|
changelog = "https://marketplace.visualstudio.com/items/Prettier.prettier-vscode/changelog";
|
|
description = "Visual Studio Code extension for Prettier";
|
|
downloadPage = "https://marketplace.visualstudio.com/items?itemName=Prettier.prettier-vscode";
|
|
homepage = "https://github.com/prettier/prettier-vscode";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ xiaoxiangmoe ];
|
|
};
|
|
})
|