about summary refs log tree commit diff
path: root/nixpkgs/pkgs/data/fonts/ubuntu-font-family/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/data/fonts/ubuntu-font-family/default.nix')
-rw-r--r--nixpkgs/pkgs/data/fonts/ubuntu-font-family/default.nix32
1 files changed, 19 insertions, 13 deletions
diff --git a/nixpkgs/pkgs/data/fonts/ubuntu-font-family/default.nix b/nixpkgs/pkgs/data/fonts/ubuntu-font-family/default.nix
index 0f1d5b5a4cc0..331e34690a5e 100644
--- a/nixpkgs/pkgs/data/fonts/ubuntu-font-family/default.nix
+++ b/nixpkgs/pkgs/data/fonts/ubuntu-font-family/default.nix
@@ -1,26 +1,32 @@
-{ lib, fetchzip }:
+{ lib, stdenvNoCC, fetchzip }:
 
-fetchzip {
-  name = "ubuntu-font-family-0.83";
+stdenvNoCC.mkDerivation rec {
+  pname = "ubuntu-font-family";
+  version = "0.83";
 
-  url = "https://assets.ubuntu.com/v1/fad7939b-ubuntu-font-family-0.83.zip";
+  src = fetchzip {
+    url = "https://assets.ubuntu.com/v1/fad7939b-ubuntu-font-family-${version}.zip";
+    hash = "sha256-FAg1xn8Gcbwmuvqtg9SquSet4oTT9nqE+Izeq7ZMVcA=";
+  };
 
-  postFetch = ''
-    mkdir -p $out/share/fonts
-    unzip -j $downloadedFile \*.ttf -d $out/share/fonts/ubuntu
-  '';
+  installPhase = ''
+    runHook preInstall
 
-  sha256 = "090y665h4kf2bi623532l6wiwkwnpd0xds0jr7560xwfwys1hiqh";
+    mkdir -p $out/share/fonts/ubuntu
+    mv *.ttf $out/share/fonts/ubuntu
+
+    runHook postInstall
+  '';
 
-  meta = {
+  meta = with lib; {
     description = "Ubuntu Font Family";
     longDescription = "The Ubuntu typeface has been specially
     created to complement the Ubuntu tone of voice. It has a
     contemporary style and contains characteristics unique to
     the Ubuntu brand that convey a precise, reliable and free attitude.";
     homepage = "http://font.ubuntu.com/";
-    license = lib.licenses.free;
-    platforms = lib.platforms.all;
-    maintainers = [ lib.maintainers.antono ];
+    license = licenses.free;
+    platforms = platforms.all;
+    maintainers = [ maintainers.antono ];
   };
 }