project-sekai-cursors: init

This commit is contained in:
uku 2025-06-05 12:02:01 +02:00
parent b730a1516e
commit 63a165b801
Signed by: uku
SSH key fingerprint: SHA256:4P0aN6M8ajKukNi6aPOaX0LacanGYtlfjmN+m/sHY/o
4 changed files with 117 additions and 0 deletions

View file

@ -4,6 +4,7 @@ final: prev: {
jaspersoft-studio-community = prev.callPackage ./jaspersoft-studio-community.nix { }; jaspersoft-studio-community = prev.callPackage ./jaspersoft-studio-community.nix { };
liberica-17 = prev.callPackage ./liberica.nix { }; liberica-17 = prev.callPackage ./liberica.nix { };
openwebstart = prev.callPackage ./openwebstart.nix { }; openwebstart = prev.callPackage ./openwebstart.nix { };
project-sekai-cursors = prev.callPackage ./project-sekai-cursors/package.nix { };
shlink = prev.callPackage ./shlink/package.nix { }; shlink = prev.callPackage ./shlink/package.nix { };
sql-developer = prev.callPackage ./sql-developer.nix { }; sql-developer = prev.callPackage ./sql-developer.nix { };
vineflower = prev.callPackage ./vineflower.nix { }; vineflower = prev.callPackage ./vineflower.nix { };

View file

@ -0,0 +1,26 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq
# shellcheck shell=bash
set -euo pipefail
groups=("VirtualSinger" "leoneed" "MMJ" "VBS" "WxS" "N25")
for group in "${groups[@]}"; do
tmpfile=$(mktemp)
curl -o "$tmpfile" "https://www.colorfulstage.com/upload_images/media/Download/ani%20file-animation-${group}.zip"
hash=$(nix-hash --sri --flat --type sha256 "$tmpfile")
updatedContent=$(jq ".\"$group-ani\" = \"$hash\"" ./hashes.json)
echo -E "$updatedContent" > ./hashes.json
done
for group in "${groups[@]}"; do
tmpfile=$(mktemp)
curl -o "$tmpfile" "https://www.colorfulstage.com/upload_images/media/Download/cur%20file-static-${group}.zip"
hash=$(nix-hash --sri --flat --type sha256 "$tmpfile")
updatedContent=$(jq ".\"$group-cur\" = \"$hash\"" ./hashes.json)
echo -E "$updatedContent" > ./hashes.json
done

View file

@ -0,0 +1,14 @@
{
"VirtualSinger-ani": "sha256-YUWi9VFoU3UkLMJjC5SB3jzkmXrcoLttj3w/D35Vrco=",
"leoneed-ani": "sha256-5HlCdQ5SZ2TCeMjD33FmkhZN+BJOT1Y/eHBvsgsAblk=",
"MMJ-ani": "sha256-AYOkEGiScmVtO+NOpe4xtbyn4408iRVXN6Bhdh/pNig=",
"VBS-ani": "sha256-oh2rj0oIPBXMWdi7gHNhqlb7VatQiVOfIjt32juAE5o=",
"WxS-ani": "sha256-r7+UW0m72QVDIShDsUhrzfVwHy82q3KfHGTcBl9nooE=",
"N25-ani": "sha256-clGFuHrFMUV5Va/btiKctQBXVx5c6MGCkAs6Iw3G0Ig=",
"VirtualSinger-cur": "sha256-s9+CVTaj+z2UKgbEq0+3z3ql+30S1Q2w2iGFR/FZRxE=",
"leoneed-cur": "sha256-o/d8le0+4TnKvyPj3SgETQCZ30fhppgqvsr/uHa5dho=",
"MMJ-cur": "sha256-fsLPVuKDqxJjpZl27Ih3+6ybj8aEzVvIZpW4Wmu34v4=",
"VBS-cur": "sha256-+Me8JuSK/4bA37l0Gin2s+0A2xe7PKQ1LR8y5SmI1Sc=",
"WxS-cur": "sha256-eNJtX/dwOuVdXVeGOjDHxLWQ/UdCMcwuZE4DO2d9sbI=",
"N25-cur": "sha256-PJxBWW8klKDE/G77hIHJRSyy5p6W/ICmFMobaw3c3Ww="
}

View file

@ -0,0 +1,76 @@
{
lib,
stdenvNoCC,
fetchurl,
unzip,
win2xcur,
# options
group ? "",
animated ? false,
# can be specified if the provided hashes do not suffice
hash ? null,
}:
let
format = if animated then "ani" else "cur";
suffix = if animated then "animation" else "static";
hashes = lib.importJSON ./hashes.json;
addmissing = fetchurl {
url = "https://gist.githubusercontent.com/uku3lig/1a761983e4ae467009a682bea505a513/raw/80ff57a2f4866ede5984e34c48dba1413d1ad353/addmissing.sh";
hash = "sha256-UTe3LKcmES6G1XHVvCN9Mvs3fVqaj0+bsv+0E33PmYk=";
};
in
stdenvNoCC.mkDerivation {
pname = "project-sekai-cursors-${group}-${suffix}";
version = "0";
src = fetchurl {
url = "https://www.colorfulstage.com/upload_images/media/Download/${format}%20file-${suffix}-${group}.zip";
hash = hashes."${group}-${format}" or hash;
};
nativeBuildInputs = [
unzip
win2xcur
];
unpackCmd = "unzip $src -d source";
sourceRoot = "source";
buildPhase = ''
mkdir output/
win2xcur *.{ani,cur} -o output
pushd output
mv Busy wait
mv Diagonal1 size_fdiag
mv Diagonal2 size_bdiag
mv Help help
mv Horizontal ew-resize
mv Link pointer
mv Move move
mv Normal default
mv Precision cross
mv Text text
mv Unavailable not-allowed
mv Vertical ns-resize
mv Working half-busy
bash ${addmissing}
popd
'';
installPhase = ''
mkdir -p "$out/share/icons/${group} Miku/cursors"
cp output/{*,.*} "$out/share/icons/${group} Miku/cursors"
echo -e "[Icon Theme]\nName=${group} Miku" > "$out/share/icons/${group} Miku/index.theme"
echo -e "[Icon Theme]\nInherits=${group} Miku" > "$out/share/icons/${group} Miku/cursor.theme"
'';
meta = {
platforms = lib.platforms.all;
hydraPlatforms = [ ];
};
}