Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 fetchurl,
4 stdenv,
5 runCommand,
6}:
7let
8 inherit (stdenv.hostPlatform) system;
9 throwSystem = throw "tailwindcss has not been packaged for ${system} yet.";
10
11 plat =
12 {
13 aarch64-darwin = "macos-arm64";
14 aarch64-linux = "linux-arm64";
15 armv7l-linux = "linux-armv7";
16 x86_64-darwin = "macos-x64";
17 x86_64-linux = "linux-x64";
18 }
19 .${system} or throwSystem;
20
21 hash =
22 {
23 aarch64-darwin = "sha256-odDHmFdZrMygvxLlGsHcvw9s8v/7Yubg9i0JHEd6EKM=";
24 aarch64-linux = "sha256-abE3i4EzGS19L+sSoRb6EtA1WU9Y2z7/IVh55K2M85s=";
25 armv7l-linux = "sha256-cE59ka+6bh9jCImv0NfbNrRjTmKFEswUHVBKW+riiGA=";
26 x86_64-darwin = "sha256-bL2tdL53bAh/+l6aBXUSxUiY+f6IKNM2IhLf4y/JM6M=";
27 x86_64-linux = "sha256-fST3+hkdIZO3jNX1pCpgk+FECVIZCFKfQtgLEf3h8dQ=";
28 }
29 .${system} or throwSystem;
30in
31stdenv.mkDerivation (finalAttrs: {
32 pname = "tailwindcss_3";
33 version = "3.4.17";
34
35 src = fetchurl {
36 url = "https://github.com/tailwindlabs/tailwindcss/releases/download/v${finalAttrs.version}/tailwindcss-${plat}";
37 inherit hash;
38 };
39
40 dontUnpack = true;
41 dontConfigure = true;
42 dontBuild = true;
43 dontFixup = true;
44
45 installPhase = ''
46 runHook preInstall
47 mkdir -p $out/bin
48 cp ${finalAttrs.src} $out/bin/tailwindcss
49 chmod 755 $out/bin/tailwindcss
50 runHook postInstall
51 '';
52
53 passthru.tests.helptext = runCommand "tailwindcss-test-helptext" { } ''
54 ${lib.getExe finalAttrs.finalPackage} --help > $out
55 '';
56 passthru.updateScript = ./update.sh;
57
58 meta = with lib; {
59 description = "Command-line tool for the CSS framework with composable CSS classes, standalone CLI";
60 homepage = "https://tailwindcss.com/blog/standalone-cli";
61 license = licenses.mit;
62 sourceProvenance = [ sourceTypes.binaryNativeCode ];
63 maintainers = [ maintainers.adamcstephens ];
64 mainProgram = "tailwindcss";
65 platforms = platforms.darwin ++ platforms.linux;
66 };
67})