nixpkgs/pkgs/development/tools/tailwindcss/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.8 KiB
Nix
Raw Normal View History

2023-06-28 16:11:25 +00:00
{ lib
, fetchurl
, stdenv
, runCommand
2023-07-04 23:02:50 +00:00
, tailwindcss
2023-06-28 16:11:25 +00:00
,
}:
let
inherit (stdenv.hostPlatform) system;
2023-07-04 23:02:50 +00:00
throwSystem = throw "tailwindcss has not been packaged for ${system} yet.";
2023-06-28 16:11:25 +00:00
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 = {
2024-01-12 18:15:58 +00:00
aarch64-darwin = "sha256-QHOOWezvBvlVJDFU59HG6vETcAN8vu5KMsMTg4fi2l0=";
aarch64-linux = "sha256-EXjD6LRLnrQ/QOeG7iVmTJPYP20FsGLA2cr0ENZNVYc=";
armv7l-linux = "sha256-OOAEsUQARJXNFIYhrbhSwh1dNQ5mMIyP+eL9kKFXJvU=";
x86_64-darwin = "sha256-WU0BsDISUZnbEFxmH+I95MBpAGkhuW9/7pjuT7wV+AA=";
x86_64-linux = "sha256-poFMyPtuVz3WNzUgk/O46SfFyGKLH/h4JmUpNa8UMLE=";
2023-06-28 16:11:25 +00:00
}.${system} or throwSystem;
in
stdenv.mkDerivation rec {
2023-07-04 23:02:50 +00:00
pname = "tailwindcss";
2024-01-12 18:15:58 +00:00
version = "3.4.1";
2023-06-28 16:11:25 +00:00
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" { } ''
2023-07-04 23:02:50 +00:00
${tailwindcss}/bin/tailwindcss --help > $out
2023-06-28 16:11:25 +00:00
'';
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 ];
2023-08-17 16:44:23 +00:00
mainProgram = "tailwindcss";
2023-06-28 16:11:25 +00:00
platforms = platforms.darwin ++ platforms.linux;
};
}