push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
{
lib,
stdenv,
fetchurl,
versionCheckHook,
autoPatchelfHook,
makeWrapper,
}:
let
version = "4.1.14";
inherit (stdenv.hostPlatform) system;
throwSystem = throw "tailwindcss has not been packaged for ${system} yet.";
plat =
{
aarch64-darwin = "macos-arm64";
aarch64-linux = "linux-arm64";
x86_64-darwin = "macos-x64";
x86_64-linux = "linux-x64";
}
.${system} or throwSystem;
hash =
{
aarch64-darwin = "sha256-5yK3UvUd74bULohrTBFx8tCaS+GnSHoKUeSv+OdgPOM=";
aarch64-linux = "sha256-MUlB9fbhQ+dOdAxYetH7qu3lRiVy3TMLvgk35hHpZts=";
x86_64-darwin = "sha256-Z7JbYQP6dndjflpd4zJ/7DM12jFtkNP9saTNcr2kHAo=";
x86_64-linux = "sha256-vDTDAbCAtua5jtJBGEGYM/lm9vNH5VaUXWVX02pEpW4=";
}
.${system} or throwSystem;
in
stdenv.mkDerivation {
inherit version;
pname = "tailwindcss_4";
src = fetchurl {
url =
"https://github.com/tailwindlabs/tailwindcss/releases/download/v${version}/tailwindcss-" + plat;
inherit hash;
};
nativeBuildInputs = lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
buildInputs = [ makeWrapper ];
dontUnpack = true;
dontBuild = true;
dontStrip = true;
installPhase = ''
mkdir -p $out/bin
install -m755 $src $out/bin/tailwindcss
'';
# libstdc++.so.6 for @parcel/watcher
postFixup = ''
wrapProgram $out/bin/tailwindcss --prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath [ stdenv.cc.cc.lib ]
}
'';
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/tailwindcss";
versionCheckProgramArg = "--help";
passthru.updateScript = ./update.sh;
meta = {
description = "Command-line tool for the CSS framework with composable CSS classes, standalone v4 CLI";
homepage = "https://tailwindcss.com/blog/tailwindcss-v4";
license = lib.licenses.mit;
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
maintainers = with lib.maintainers; [
adamcstephens
adamjhf
];
mainProgram = "tailwindcss";
platforms = lib.platforms.darwin ++ lib.platforms.linux;
};
}

View File

@@ -0,0 +1,35 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnused gawk nix-prefetch common-updater-scripts jq ripgrep
set -euo pipefail
ROOT="$(dirname "$(readlink -f "$0")")"
NIX_DRV="$ROOT/package.nix"
if [ ! -f "$NIX_DRV" ]; then
echo "ERROR: cannot find package.nix in $ROOT"
exit 1
fi
fetch_arch() {
VER="$1"; ARCH="$2"
URL="https://github.com/tailwindlabs/tailwindcss/releases/download/v${VER}/tailwindcss-${ARCH}"
nix-hash --to-sri --type sha256 "$(nix-prefetch-url --type sha256 "$URL")"
}
replace_hash() {
sed -i "s#$1 = \"sha256-.\{44\}\"#$1 = \"$2\"#" "$NIX_DRV"
}
VER=$(list-git-tags --url=https://github.com/tailwindlabs/tailwindcss | rg 'v4[0-9\.]*$' | sed -e 's/^v//' | sort -V | tail -n 1)
LINUX_X64_HASH=$(fetch_arch "$VER" "linux-x64")
LINUX_AARCH64_HASH=$(fetch_arch "$VER" "linux-arm64")
DARWIN_X64_HASH=$(fetch_arch "$VER" "macos-x64")
DARWIN_AARCH64_HASH=$(fetch_arch "$VER" "macos-arm64")
sed -i "s/version = \".*\"/version = \"$VER\"/" "$NIX_DRV"
replace_hash "x86_64-linux" "$LINUX_X64_HASH"
replace_hash "aarch64-linux" "$LINUX_AARCH64_HASH"
replace_hash "x86_64-darwin" "$DARWIN_X64_HASH"
replace_hash "aarch64-darwin" "$DARWIN_AARCH64_HASH"