2022-10-30 15:09:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchFromGitHub
|
2023-01-20 10:41:00 +00:00
|
|
|
, unzip
|
2022-10-30 15:09:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
dimensions = {
|
|
|
|
palette = [ "Frappe" "Latte" "Macchiato" "Mocha" ];
|
|
|
|
color = [ "Blue" "Dark" "Flamingo" "Green" "Lavender" "Light" "Maroon" "Mauve" "Peach" "Pink" "Red" "Rosewater" "Sapphire" "Sky" "Teal" "Yellow" ];
|
|
|
|
};
|
|
|
|
product = lib.attrsets.cartesianProductOfSets dimensions;
|
|
|
|
variantName = { palette, color }: (lib.strings.toLower palette) + color;
|
|
|
|
variants = map variantName product;
|
|
|
|
in
|
2023-01-20 10:41:00 +00:00
|
|
|
stdenvNoCC.mkDerivation rec {
|
2022-10-30 15:09:59 +00:00
|
|
|
pname = "catppuccin-cursors";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.2.0";
|
|
|
|
dontBuild = true;
|
2022-10-30 15:09:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "catppuccin";
|
|
|
|
repo = "cursors";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-TgV5f8+YWR+h61m6WiBMg3aBFnhqShocZBdzZHSyU2c=";
|
|
|
|
sparseCheckout = [ "cursors" ];
|
2022-10-30 15:09:59 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
outputs = variants ++ [ "out" ]; # dummy "out" output to prevent breakage
|
|
|
|
|
|
|
|
outputsToInstall = [];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
for output in $(getAllOutputNames); do
|
2022-10-30 15:09:59 +00:00
|
|
|
if [ "$output" != "out" ]; then
|
|
|
|
local outputDir="''${!output}"
|
|
|
|
local iconsDir="$outputDir"/share/icons
|
|
|
|
|
|
|
|
mkdir -p "$iconsDir"
|
|
|
|
|
|
|
|
# Convert to kebab case with the first letter of each word capitalized
|
|
|
|
local variant=$(sed 's/\([A-Z]\)/-\1/g' <<< "$output")
|
|
|
|
local variant=''${variant^}
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
unzip "cursors/Catppuccin-$variant-Cursors.zip" -d "$iconsDir"
|
2022-10-30 15:09:59 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Needed to prevent breakage
|
|
|
|
mkdir -p "$out"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Catppuccin cursor theme based on Volantes";
|
|
|
|
homepage = "https://github.com/catppuccin/cursors";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ PlayerNameHere ];
|
|
|
|
};
|
|
|
|
}
|