Skip to content

Commit a2de575

Browse files
authored
tailwindcss: make v4 default, move tailwindcss_3 to by-name (#382685)
2 parents 2f6b75b + 285bd8d commit a2de575

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ tailwindcss_4 }: tailwindcss_4

pkgs/development/tools/tailwindcss/default.nix renamed to pkgs/by-name/ta/tailwindcss_3/package.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
fetchurl,
44
stdenv,
55
runCommand,
6-
tailwindcss,
76
}:
87
let
98
inherit (stdenv.hostPlatform) system;
@@ -30,7 +29,7 @@ let
3029
.${system} or throwSystem;
3130
in
3231
stdenv.mkDerivation (finalAttrs: {
33-
pname = "tailwindcss";
32+
pname = "tailwindcss_3";
3433
version = "3.4.17";
3534

3635
src = fetchurl {

pkgs/development/tools/tailwindcss/update.sh renamed to pkgs/by-name/ta/tailwindcss_3/update.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
#!/usr/bin/env nix-shell
2-
#!nix-shell -i bash -p curl gnused jq nix-prefetch
2+
#!nix-shell -i bash -p common-updater-scripts gnused jq nix-prefetch
33
set -eou pipefail
44

55
ROOT="$(dirname "$(readlink -f "$0")")"
66

7-
CURRENT_VERSION=$(nix-instantiate --eval --strict --json -A tailwindcss.version . | jq -r .)
8-
LATEST_VERSION=$(curl --fail --silent https://api.github.com/repos/tailwindlabs/tailwindcss/releases/latest | jq --raw-output .tag_name | sed 's/v//')
9-
sed -i "s/version = \".*\"/version = \"${LATEST_VERSION}\"/" "$ROOT/default.nix"
7+
CURRENT_VERSION=$(nix-instantiate --eval --strict --json -A tailwindcss_3.version . | jq -r .)
8+
LATEST_VERSION=$(list-git-tags --url=https://github.com/tailwindlabs/tailwindcss | rg 'v3[0-9\.]*$' | sed -e 's/^v//' | sort -V | tail -n 1)
9+
sed -i "s/version = \".*\"/version = \"${LATEST_VERSION}\"/" "$ROOT/package.nix"
1010

1111
if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
12-
echo "tailwindcss already at latest version $CURRENT_VERSION, exiting"
12+
echo "tailwindcss_3 already at latest version $CURRENT_VERSION, exiting"
1313
exit 0
1414
fi
1515

1616
function updatePlatform() {
1717
NIXPLAT=$1
1818
TAILWINDPLAT=$2
19-
echo "Updating tailwindcss for $NIXPLAT"
19+
echo "Updating tailwindcss_3 for $NIXPLAT"
2020

2121
URL="https://github.com/tailwindlabs/tailwindcss/releases/download/v${LATEST_VERSION}/tailwindcss-${TAILWINDPLAT}"
2222
HASH=$(nix hash to-sri --type sha256 "$(nix-prefetch-url --type sha256 "$URL")")
2323

24-
sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/default.nix"
24+
sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/package.nix"
2525
}
2626

2727
updatePlatform aarch64-darwin macos-arm64

pkgs/by-name/ta/tailwindcss_4/package.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
versionCheckHook,
66
autoPatchelfHook,
77
makeWrapper,
8-
tailwindcss_4,
98
}:
109
let
1110
version = "4.0.6";
@@ -71,7 +70,10 @@ stdenv.mkDerivation {
7170
homepage = "https://tailwindcss.com/blog/tailwindcss-v4";
7271
license = lib.licenses.mit;
7372
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
74-
maintainers = [ lib.maintainers.adamjhf ];
73+
maintainers = with lib.maintainers; [
74+
adamcstephens
75+
adamjhf
76+
];
7577
mainProgram = "tailwindcss";
7678
platforms = lib.platforms.darwin ++ lib.platforms.linux;
7779
};

pkgs/by-name/ta/tailwindcss_4/update.sh

100644100755
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
#!/usr/bin/env nix-shell
2-
#!nix-shell -i bash -p curl gnused jq nix-prefetch
2+
#!nix-shell -i bash -p common-updater-scripts gnused jq nix-prefetch
33
set -eou pipefail
44

55
ROOT="$(dirname "$(readlink -f "$0")")"
66

77
CURRENT_VERSION=$(nix-instantiate --eval --strict --json -A tailwindcss.version . | jq -r .)
8-
LATEST_VERSION=$(curl --fail --silent https://api.github.com/repos/tailwindlabs/tailwindcss/releases/latest | jq --raw-output .tag_name | sed 's/v//')
9-
sed -i "s/version = \".*\"/version = \"${LATEST_VERSION}\"/" "$ROOT/default.nix"
8+
LATEST_VERSION=$(list-git-tags --url=https://github.com/tailwindlabs/tailwindcss | rg 'v4[0-9\.]*$' | sed -e 's/^v//' | sort -V | tail -n 1)
9+
sed -i "s/version = \".*\"/version = \"${LATEST_VERSION}\"/" "$ROOT/package.nix"
1010

1111
if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
12-
echo "tailwindcss already at latest version $CURRENT_VERSION, exiting"
12+
echo "tailwindcss_4 already at latest version $CURRENT_VERSION, exiting"
1313
exit 0
1414
fi
1515

1616
function updatePlatform() {
1717
NIXPLAT=$1
1818
TAILWINDPLAT=$2
19-
echo "Updating tailwindcss for $NIXPLAT"
19+
echo "Updating tailwindcss_4 for $NIXPLAT"
2020

2121
URL="https://github.com/tailwindlabs/tailwindcss/releases/download/v${LATEST_VERSION}/tailwindcss-${TAILWINDPLAT}"
2222
HASH=$(nix hash to-sri --type sha256 "$(nix-prefetch-url --type sha256 "$URL")")
2323

24-
sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/default.nix"
24+
sed -i "s,$NIXPLAT = \"sha256.*\",$NIXPLAT = \"${HASH}\"," "$ROOT/package.nix"
2525
}
2626

2727
updatePlatform aarch64-darwin macos-arm64

pkgs/top-level/all-packages.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,8 +1081,6 @@ with pkgs;
10811081
ocamlPackages = ocaml-ng.ocamlPackages_4_14;
10821082
};
10831083

1084-
tailwindcss = callPackage ../development/tools/tailwindcss { };
1085-
10861084
ufolint = with python3Packages; toPythonApplication ufolint;
10871085

10881086
valeronoi = qt6Packages.callPackage ../tools/misc/valeronoi { };

0 commit comments

Comments
 (0)