nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchPnpmDeps,
6 nodejs,
7 pnpm,
8 pnpmConfigHook,
9 nix-update-script,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "postcss";
14 version = "8.5.6";
15
16 src = fetchFromGitHub {
17 owner = "postcss";
18 repo = "postcss";
19 tag = finalAttrs.version;
20 hash = "sha256-7oGCDqKwJG49DXDiyEZaO8EhxZS/Up5PO3/uqqOa+Bo=";
21 };
22
23 nativeBuildInputs = [
24 nodejs
25 pnpmConfigHook
26 pnpm
27 ];
28
29 pnpmDeps = fetchPnpmDeps {
30 inherit (finalAttrs) pname version src;
31 fetcherVersion = 3;
32 hash = "sha256-WJTQjlOkzCSqPHkNuT/Dn1BOFyL+3lDSl7RW0S9fakU=";
33 };
34
35 dontBuild = true;
36
37 installPhase = ''
38 runHook preInstall
39
40 rm -rf node_modules
41 pnpm install --production --offline --force
42 mkdir -p $out/lib/node_modules/postcss
43 mv ./* $out/lib/node_modules/postcss
44
45 runHook postInstall
46 '';
47
48 passthru.updateScript = nix-update-script { };
49
50 meta = {
51 changelog = "https://github.com/postcss/postcss/releases/tag/${finalAttrs.version}";
52 description = "Transforming styles with JS plugins";
53 homepage = "https://postcss.org/";
54 license = lib.licenses.mit;
55 maintainers = with lib.maintainers; [ pyrox0 ];
56 platforms = lib.platforms.all;
57 };
58})