summary refs log tree commit diff
diff options
context:
space:
mode:
authorDixon Sean Low Yan Feng <dixonseanlow@protonmail.com>2022-10-25 20:26:52 +0800
committerDixon Sean Low Yan Feng <dixonseanlow@protonmail.com>2022-10-25 20:26:52 +0800
commitc03626c2e34779d417fe4bb3968da73623b1b413 (patch)
treed382ee5d5c6e071766dd50e9177f57b31b47bc94
parent2da64a81275b68fdad38af669afeda43d401e94b (diff)
catppuccin-cursors: init at unstable-2022-08-23
-rw-r--r--maintainers/maintainer-list.nix9
-rw-r--r--pkgs/data/icons/catppuccin-cursors/default.nix81
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 92 insertions, 0 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index b6192f78a8bf0..cc86a7aaa4ce7 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -10386,6 +10386,15 @@
       fingerprint = "B00F E582 FD3F 0732 EA48  3937 F558 14E4 D687 4375";
     }];
   };
+  PlayerNameHere = {
+    name = "Dixon Sean Low Yan Feng";
+    email = "dixonseanlow@protonmail.com";
+    github = "PlayerNameHere";
+    githubId = 56017218;
+    keys = [{
+      fingerprint = "E6F4 BFB4 8DE3 893F 68FC  A15F FF5F 4B30 A41B BAC8";
+    }];
+  };
   plchldr = {
     email = "mail@oddco.de";
     github = "plchldr";
diff --git a/pkgs/data/icons/catppuccin-cursors/default.nix b/pkgs/data/icons/catppuccin-cursors/default.nix
new file mode 100644
index 0000000000000..d9eccc96a0291
--- /dev/null
+++ b/pkgs/data/icons/catppuccin-cursors/default.nix
@@ -0,0 +1,81 @@
+{ lib
+, stdenvNoCC
+, fetchFromGitHub
+, inkscape
+, xcursorgen
+, makeFontsConf
+}:
+
+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
+stdenvNoCC.mkDerivation {
+  pname = "catppuccin-cursors";
+  version = "unstable-2022-08-23";
+
+  src = fetchFromGitHub {
+    owner = "catppuccin";
+    repo = "cursors";
+    rev = "3d3023606939471c45cff7b643bffc5d5d4ff29c";
+    sha256 = "1z9cjxxsj3vrmhsw1k05b31zmncz1ksaswc4r1k3vd2mmpigq1nk";
+  };
+
+  outputs = variants ++ [ "out" ]; # dummy "out" output to prevent breakage
+
+  outputsToInstall = [];
+
+  nativeBuildInputs = [
+    inkscape
+    xcursorgen
+  ];
+
+  postPatch = ''
+    patchShebangs ./build.sh
+  '';
+
+  # Make fontconfig stop warning about being unable to load config
+  FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; };
+
+  # Make inkscape stop warning about being unable to create profile directory
+  preBuild = ''
+    export HOME="$NIX_BUILD_ROOT"
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    for output in $outputs; do
+      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^}
+
+        cp -r dist/Catppuccin-"$variant"-Cursors "$iconsDir"
+      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 ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 0106424aa8ebb..2f2d27515b611 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -25096,6 +25096,8 @@ with pkgs;
 
   cascadia-code = callPackage ../data/fonts/cascadia-code { };
 
+  catppuccin-cursors = callPackage ../data/icons/catppuccin-cursors { };
+
   ccsymbols = callPackage ../data/fonts/ccsymbols { };
 
   charis-sil = callPackage ../data/fonts/charis-sil { };