nvf/flake/pkgs/by-name/prettier-plugin-astro/package.nix
midischwarz12 ef0e10f591
Some checks failed
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate documentation builds-1 (push) Waiting to run
Treewide Checks / Validate documentation builds-2 (push) Waiting to run
Treewide Checks / Validate documentation builds-3 (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
prettier-plugin-astro: set HOME in build to avoid pnpm hook failure
- Export HOME=$TMPDIR in preConfigure so pnpm config doesn’t fail on /homeless-shelter
2026-03-17 23:01:04 +03:00

55 lines
1 KiB
Nix

{
stdenv,
fetchFromGitHub,
nodejs,
pnpm_9,
pnpmConfigHook,
fetchPnpmDeps,
pins,
writableTmpDirAsHomeHook,
}: 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 = fetchPnpmDeps {
pnpm = pnpm_9;
inherit (finalAttrs) pname src;
fetcherVersion = 2;
hash = "sha256-K7pIWLkIIbUKDIcysfEtcf/eVMX9ZgyFHdqcuycHCNE=";
};
nativeBuildInputs = [
nodejs
writableTmpDirAsHomeHook
(pnpmConfigHook.overrideAttrs {
propagatedBuildInputs = [pnpm_9];
})
];
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
'';
})