504525a148
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
62 lines
1.8 KiB
Nix
62 lines
1.8 KiB
Nix
{ lib
|
|
, fetchurl
|
|
, stdenv
|
|
, runCommand
|
|
, tailwindcss
|
|
,
|
|
}:
|
|
let
|
|
inherit (stdenv.hostPlatform) system;
|
|
throwSystem = throw "tailwindcss has not been packaged for ${system} yet.";
|
|
|
|
plat = {
|
|
aarch64-darwin = "macos-arm64";
|
|
aarch64-linux = "linux-arm64";
|
|
armv7l-linux = "linux-armv7";
|
|
x86_64-darwin = "macos-x64";
|
|
x86_64-linux = "linux-x64";
|
|
}.${system} or throwSystem;
|
|
|
|
hash = {
|
|
aarch64-darwin = "sha256-m35adxhRSEFV6BIpn89VKVQRklI+xWK4sNO4u2corCg=";
|
|
aarch64-linux = "sha256-oKSrc579aO7DxOsP9UTE0LZsKfNoIdZ97Uy1nTMjGqk=";
|
|
armv7l-linux = "sha256-YJ0UGQuBl0Etsw1cra2i741RQ7NOOyoYPmvNWCOeOIU=";
|
|
x86_64-darwin = "sha256-5R5iGn2uJuTMQwnsXQmfDkyGAPLbP+j9OHzt5OMIW8E=";
|
|
x86_64-linux = "sha256-S4/rjrBjK7sh5D+V6On/r5NXLII0fClnS+7lKmDEML4=";
|
|
}.${system} or throwSystem;
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "tailwindcss";
|
|
version = "3.4.0";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/tailwindlabs/tailwindcss/releases/download/v${version}/tailwindcss-${plat}";
|
|
inherit hash;
|
|
};
|
|
|
|
dontUnpack = true;
|
|
dontConfigure = true;
|
|
dontBuild = true;
|
|
dontFixup = true;
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp ${src} $out/bin/tailwindcss
|
|
chmod 755 $out/bin/tailwindcss
|
|
'';
|
|
|
|
passthru.tests.helptext = runCommand "tailwindcss-test-helptext" { } ''
|
|
${tailwindcss}/bin/tailwindcss --help > $out
|
|
'';
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
meta = with lib; {
|
|
description = "Command-line tool for the CSS framework with composable CSS classes, standalone CLI";
|
|
homepage = "https://tailwindcss.com/blog/standalone-cli";
|
|
license = licenses.mit;
|
|
sourceProvenance = [ sourceTypes.binaryNativeCode ];
|
|
maintainers = [ maintainers.adamcstephens ];
|
|
mainProgram = "tailwindcss";
|
|
platforms = platforms.darwin ++ platforms.linux;
|
|
};
|
|
}
|