about summary refs log tree commit diff
path: root/pkgs/data
diff options
context:
space:
mode:
authorAustin Horstman <khaneliman12@gmail.com>2024-03-21 08:52:06 -0500
committerAustin Horstman <khaneliman12@gmail.com>2024-03-27 13:59:37 -0500
commit3ad55657876b3d698c6434875abab01941323589 (patch)
tree27b3ae1ff373e482a5df0cabd1286e442f6c817d /pkgs/data
parent2d96747851e5c635234001bbe482d445204fc57b (diff)
sketchybar-app-font: 2.0.12 -> 2.0.14
Also added icon_map.sh and icon_map.lua artifacts
Diffstat (limited to 'pkgs/data')
-rw-r--r--pkgs/data/fonts/sketchybar-app-font/default.nix51
1 files changed, 42 insertions, 9 deletions
diff --git a/pkgs/data/fonts/sketchybar-app-font/default.nix b/pkgs/data/fonts/sketchybar-app-font/default.nix
index cd9af9a9c5f47..c337448a72e6b 100644
--- a/pkgs/data/fonts/sketchybar-app-font/default.nix
+++ b/pkgs/data/fonts/sketchybar-app-font/default.nix
@@ -1,23 +1,56 @@
+let
+  artifacts = [ "shell" "lua" "font" ];
+in
 { lib
 , stdenvNoCC
 , fetchurl
+, artifactList ? artifacts
 }:
-
-stdenvNoCC.mkDerivation (finalAttrs: {
+let
   pname = "sketchybar-app-font";
-  version = "2.0.12";
+  version = "2.0.14";
 
-  src = fetchurl {
-    url = "https://github.com/kvndrsslr/sketchybar-app-font/releases/download/v${finalAttrs.version}/sketchybar-app-font.ttf";
-    hash = "sha256-qACf4eWDeubBmJV0ApWidp2ESLREi5qiLliWCXoMBKY=";
+  selectedSources = map (themeName: builtins.getAttr themeName sources) artifactList;
+  sources = {
+    font = fetchurl {
+      url = "https://github.com/kvndrsslr/sketchybar-app-font/releases/download/v${version}/sketchybar-app-font.ttf";
+      hash = "sha256-lGzNLBtM+1Cl9tTB4yKkc46ZqDjyt8J0EPNTM/eAziY=";
+    };
+    lua = fetchurl {
+      url = "https://github.com/kvndrsslr/sketchybar-app-font/releases/download/v${version}/icon_map.lua";
+      hash = "sha256-YLr7dlKliKLUEK18uG4ouXfLqodVpcDQzfu+H1+oe/w=";
+    };
+    shell = fetchurl {
+      url = "https://github.com/kvndrsslr/sketchybar-app-font/releases/download/v${version}/icon_map.sh";
+      hash = "sha256-ZT/k6Vk/nO6mq1yplXaWyz9HxqwEiVWba+rk+pIRZq4=";
+    };
   };
+in
+lib.checkListOfEnum "${pname}: artifacts" artifacts artifactList
+  stdenvNoCC.mkDerivation
+{
+  inherit pname version;
+
+  srcs = selectedSources;
 
-  dontUnpack = true;
+  unpackPhase = ''
+    for s in $selectedSources; do
+      b=$(basename $s)
+      cp $s ''${b#*-}
+    done
+  '';
 
   installPhase = ''
     runHook preInstall
 
-    install -Dm644 $src $out/share/fonts/truetype/sketchybar-app-font.ttf
+  '' + lib.optionalString (lib.elem "font" artifactList) ''
+    install -Dm644 ${sources.font} "$out/share/fonts/truetype/sketchybar-app-font.ttf"
+
+  '' + lib.optionalString (lib.elem "shell" artifactList) ''
+    install -Dm755 ${sources.shell} "$out/bin/icon_map.sh"
+
+  '' + lib.optionalString (lib.elem "lua" artifactList) ''
+    install -Dm644 ${sources.lua} "$out/lib/${pname}/icon_map.lua"
 
     runHook postInstall
   '';
@@ -31,4 +64,4 @@ stdenvNoCC.mkDerivation (finalAttrs: {
     license = lib.licenses.cc0;
     maintainers = with lib.maintainers; [ khaneliman ];
   };
-})
+}