From db30023c78b33a6b1f6108c7bd37527f450e706b Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Tue, 14 Oct 2025 20:28:22 +0200 Subject: [PATCH] package: add prettier-plugin-astro --- .../by-name/prettier-plugin-astro/package.nix | 48 +++++++++++++++++++ npins/sources.json | 16 +++++++ 2 files changed, 64 insertions(+) create mode 100644 flake/pkgs/by-name/prettier-plugin-astro/package.nix diff --git a/flake/pkgs/by-name/prettier-plugin-astro/package.nix b/flake/pkgs/by-name/prettier-plugin-astro/package.nix new file mode 100644 index 00000000..d893da7c --- /dev/null +++ b/flake/pkgs/by-name/prettier-plugin-astro/package.nix @@ -0,0 +1,48 @@ +{ + stdenv, + fetchFromGitHub, + nodejs, + pnpm_9, + pins, +}: let + pin = pins.prettier-plugin-astro; +in + stdenv.mkDerivation (finalAttrs: { + pname = "prettier-plugin-astro"; + version = pin.version or pin.revision; + + src = fetchFromGitHub { + inherit (pin.repository) owner repo; + rev = finalAttrs.version; + sha256 = pin.hash; + }; + + pnpmDeps = pnpm_9.fetchDeps { + inherit (finalAttrs) pname src; + fetcherVersion = 2; + hash = "sha256-K7pIWLkIIbUKDIcysfEtcf/eVMX9ZgyFHdqcuycHCNE="; + }; + + nativeBuildInputs = [ + nodejs + pnpm_9.configHook + ]; + + buildPhase = '' + runHook preBuild + + pnpm run build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + # mkdir -p $out/dist + cp -r dist/ $out + cp -r node_modules $out + + runHook postInstall + ''; + }) diff --git a/npins/sources.json b/npins/sources.json index 3f9db0b1..828f9bac 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -2218,6 +2218,22 @@ "url": "https://github.com/tris203/precognition.nvim/archive/2aae2687207029b3611a0e19a289f9e1c7efbe16.tar.gz", "hash": "0b4yz5jvqd0li373067cs1n761vn9jxkhcvhsrvm9h1snqw1c6nk" }, + "prettier-plugin-astro": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "withastro", + "repo": "prettier-plugin-astro" + }, + "pre_releases": false, + "version_upper_bound": null, + "release_prefix": null, + "submodules": false, + "version": "v0.14.1", + "revision": "57234893ca374c8e401cce1f931180d314e13eac", + "url": "https://api.github.com/repos/withastro/prettier-plugin-astro/tarball/v0.14.1", + "hash": "14ffwxggcnyc947pdxgsgz1v2q76m5xmybfxg8kyla4l7phg6qsw" + }, "project-nvim": { "type": "Git", "repository": {