summary refs log tree commit diff
path: root/pkgs/data/fonts/weather-icons
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-01-28 07:27:25 +0100
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2023-01-28 07:27:25 +0100
commita6e94af6ef5b526386567b6bd5f219c64a9c543b (patch)
tree1c95c6d4bd6aa1f88b3a2cc6c945cc69b81ad1e9 /pkgs/data/fonts/weather-icons
parent3dd3562fa08e5a7cbe58c91b7f5b4aacd92d4012 (diff)
downloadnixpkgs-a6e94af6ef5b526386567b6bd5f219c64a9c543b.tar
nixpkgs-a6e94af6ef5b526386567b6bd5f219c64a9c543b.tar.gz
nixpkgs-a6e94af6ef5b526386567b6bd5f219c64a9c543b.tar.bz2
nixpkgs-a6e94af6ef5b526386567b6bd5f219c64a9c543b.tar.lz
nixpkgs-a6e94af6ef5b526386567b6bd5f219c64a9c543b.tar.xz
nixpkgs-a6e94af6ef5b526386567b6bd5f219c64a9c543b.tar.zst
nixpkgs-a6e94af6ef5b526386567b6bd5f219c64a9c543b.zip
treewide: convert 17 fonts to stdenvNoCC.mkDerivation
Diffstat (limited to 'pkgs/data/fonts/weather-icons')
-rw-r--r--pkgs/data/fonts/weather-icons/default.nix29
1 files changed, 16 insertions, 13 deletions
diff --git a/pkgs/data/fonts/weather-icons/default.nix b/pkgs/data/fonts/weather-icons/default.nix
index 7171f65cb68..00f9cebac12 100644
--- a/pkgs/data/fonts/weather-icons/default.nix
+++ b/pkgs/data/fonts/weather-icons/default.nix
@@ -1,13 +1,21 @@
-# when changing this expression convert it from 'fetchzip' to 'stdenvNoCC.mkDerivation'
-{ lib, fetchzip }:
+{ lib, stdenvNoCC, fetchzip }:
 
-let
+stdenvNoCC.mkDerivation rec {
+  pname = "weather-icons";
   version = "2.0.12";
-in (fetchzip {
-  name = "weather-icons-${version}";
 
-  url = "https://github.com/erikflowers/weather-icons/archive/refs/tags/${version}.zip";
-  sha256 = "sha256-NGPzAloeZa1nCazb+mjAbYw7ZYYDoKpLwcvzg1Ly9oM=";
+  src = fetchzip {
+    url = "https://github.com/erikflowers/weather-icons/archive/refs/tags/${version}.zip";
+    hash = "sha256-0ZFH2awUo4BkTpK1OsWZ4YKczJHo+HHM6ezGBJAmT+U=";
+  };
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm644 _docs/font-source/weathericons-regular.otf -t $out/share/fonts/opentype
+
+    runHook postInstall
+  '';
 
   meta = with lib; {
     description = "Weather Icons";
@@ -21,9 +29,4 @@ in (fetchzip {
     platforms = platforms.all;
     maintainers = with maintainers; [ pnelson ];
   };
-}).overrideAttrs (_: {
-  postFetch = ''
-    mkdir -p $out/share/fonts
-    unzip -j $downloadedFile weather-icons-${version}/_docs/font-source/weathericons-regular.otf -d $out/share/fonts/opentype
-  '';
-})
+}