postcss: migrate from nodePackages (#473891)
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchPnpmDeps,
|
||||
nodejs,
|
||||
pnpm,
|
||||
pnpmConfigHook,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "postcss";
|
||||
version = "8.5.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "postcss";
|
||||
repo = "postcss";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-7oGCDqKwJG49DXDiyEZaO8EhxZS/Up5PO3/uqqOa+Bo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
pnpmConfigHook
|
||||
pnpm
|
||||
];
|
||||
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
inherit (finalAttrs) pname version src;
|
||||
fetcherVersion = 3;
|
||||
hash = "sha256-WJTQjlOkzCSqPHkNuT/Dn1BOFyL+3lDSl7RW0S9fakU=";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
rm -rf node_modules
|
||||
pnpm install --production --offline --force
|
||||
mkdir -p $out/lib/node_modules/postcss
|
||||
mv ./* $out/lib/node_modules/postcss
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/postcss/postcss/releases/tag/${finalAttrs.version}";
|
||||
description = "Transforming styles with JS plugins";
|
||||
homepage = "https://postcss.org/";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ pyrox0 ];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
})
|
||||
@@ -1905,7 +1905,7 @@ builtins.intersectAttrs super {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.buildPackages.makeBinaryWrapper ];
|
||||
postInstall = (old.postInstall or "") + ''
|
||||
nodePath=""
|
||||
for p in "$out" "${pkgs.nodePackages.postcss}" $plugins; do
|
||||
for p in "$out" "${pkgs.postcss}" $plugins; do
|
||||
nodePath="$nodePath''${nodePath:+:}$p/lib/node_modules"
|
||||
done
|
||||
makeWrapper "$out/bin/tailwindcss" "$out/bin/tailwind" --prefix NODE_PATH : "$nodePath"
|
||||
|
||||
@@ -283,6 +283,7 @@ mapAliases {
|
||||
inherit (pkgs) pm2; # added 2024-01-22
|
||||
inherit (pkgs) pnpm; # added 2024-06-26
|
||||
poor-mans-t-sql-formatter-cli = throw "'poor-mans-t-sql-formatter-cli' has been removed because it was unmaintained upstream"; # Added 2025-11-14
|
||||
inherit (pkgs) postcss; # Added 2025-12-24
|
||||
postcss-cli = throw "postcss-cli has been removed because it was broken"; # added 2025-03-24
|
||||
prebuild-install = throw "prebuild-install was removed because it appeared to be unmaintained upstream. See upstream's recommendations for alternatives here: https://github.com/prebuild/prebuild-install#note"; # Added 2025-12-14
|
||||
inherit (pkgs) prettier; # added 2025-05-31
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
, "js-yaml"
|
||||
, "lcov-result-merger"
|
||||
, "node2nix"
|
||||
, "postcss"
|
||||
, "sass"
|
||||
, "semver"
|
||||
, "vercel"
|
||||
|
||||
-23
@@ -20996,29 +20996,6 @@ in
|
||||
bypassCache = true;
|
||||
reconstructLock = true;
|
||||
};
|
||||
postcss = nodeEnv.buildNodePackage {
|
||||
name = "postcss";
|
||||
packageName = "postcss";
|
||||
version = "8.5.3";
|
||||
src = fetchurl {
|
||||
url = "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz";
|
||||
sha512 = "dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==";
|
||||
};
|
||||
dependencies = [
|
||||
sources."nanoid-3.3.9"
|
||||
sources."picocolors-1.1.1"
|
||||
sources."source-map-js-1.2.1"
|
||||
];
|
||||
buildInputs = globalBuildInputs;
|
||||
meta = {
|
||||
description = "Tool for transforming styles with JS plugins";
|
||||
homepage = "https://postcss.org/";
|
||||
license = "MIT";
|
||||
};
|
||||
production = true;
|
||||
bypassCache = true;
|
||||
reconstructLock = true;
|
||||
};
|
||||
sass = nodeEnv.buildNodePackage {
|
||||
name = "sass";
|
||||
packageName = "sass";
|
||||
|
||||
Reference in New Issue
Block a user