depot/third_party/nixpkgs/pkgs/development/tools/tailwindcss/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

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-MncDpGRggZBuEdEW/06OQwdkZsPSaSgrvmElVbn+DFg=";
aarch64-linux = "sha256-2Hiv11tqeSlFx/I0VD8MOJt+AmAB5yUFqny3bT4eR+w=";
armv7l-linux = "sha256-msguyvTGQV7BC1eIMAGyIIaZk1qVz/pB8G8iQsKJAEA=";
x86_64-darwin = "sha256-PEQjSU2CBLN0Vct3sbhe9cbEJBP1jhUWpL91KFMcBn0=";
x86_64-linux = "sha256-yRzMhkL3nX21U46NaGpNwY4AqTGA9TdyCKmpPH77m2o=";
}.${system} or throwSystem;
in
stdenv.mkDerivation rec {
pname = "tailwindcss";
version = "3.4.13";
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;
};
}