Charlotte 🦝 Delenk
f0145fea8f
I thought the limit imposed by mastotodon < 4.0 was 40kB but it’s 50kB
46 lines
1.1 KiB
Nix
46 lines
1.1 KiB
Nix
{
|
|
fetchFromGitHub,
|
|
stdenvNoCC,
|
|
imagemagick,
|
|
lib,
|
|
callPackage,
|
|
oxipng,
|
|
pngquant,
|
|
}: let
|
|
source = builtins.fromJSON (builtins.readFile ./source.json);
|
|
in
|
|
stdenvNoCC.mkDerivation {
|
|
pname = "caroline-stickers";
|
|
version = source.date;
|
|
src = fetchFromGitHub {
|
|
owner = "CarolineHusky";
|
|
repo = "CarolineStickers";
|
|
inherit (source) rev sha256;
|
|
};
|
|
nativeBuildInputs = [
|
|
imagemagick
|
|
oxipng
|
|
pngquant
|
|
];
|
|
buildPhase = ''
|
|
rm credits_*.png
|
|
|
|
mv "bluefox_thanks I hate it.png" "bluefox_thanks_I_hate_it.png"
|
|
|
|
mogrify -resize 256x256\> *.png
|
|
|
|
find . -type f -name '*.png' -execdir ${../../../lib/crushpng.sh} {} {}.new 50000 \;
|
|
for f in $(find . -type f -name '*.new'); do
|
|
mv $f ${"$"}{f%.new}
|
|
done
|
|
'';
|
|
installPhase = ''
|
|
mkdir $out
|
|
mv *.png $out
|
|
'';
|
|
meta = {
|
|
description = "CarolineHusky stickers";
|
|
license = lib.licenses.cc-by-nc-sa-40;
|
|
};
|
|
passthru.updateScript = [../../../scripts/update-git.sh "https://github.com/CarolineHusky/CarolineStickers" "art/emoji/caro/source.json"];
|
|
}
|