summary refs log tree commit diff
path: root/pkgs/data/fonts/office-code-pro/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/data/fonts/office-code-pro/default.nix')
-rw-r--r--pkgs/data/fonts/office-code-pro/default.nix30
1 files changed, 13 insertions, 17 deletions
diff --git a/pkgs/data/fonts/office-code-pro/default.nix b/pkgs/data/fonts/office-code-pro/default.nix
index 564b950784b..4354725c90c 100644
--- a/pkgs/data/fonts/office-code-pro/default.nix
+++ b/pkgs/data/fonts/office-code-pro/default.nix
@@ -1,26 +1,23 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, fetchFromGitHub }:
 
-stdenv.mkDerivation rec {
+let
   pname = "office-code-pro";
   version = "1.004";
+in fetchFromGitHub rec {
+  name = "${pname}-${version}";
 
-  src = fetchFromGitHub {
-    owner = "nathco";
-    repo = "Office-Code-Pro";
-    rev = version;
-    sha256 = "0znmjjyn5q83chiafy252bhsmw49r2nx2ls2cmhjp4ihidfr6cmb";
-  };
+  owner = "nathco";
+  repo = "Office-Code-Pro";
+  rev = version;
 
-  installPhase = ''
-    fontDir=$out/share/fonts/opentype
-    docDir=$out/share/doc/${pname}-${version}
-    mkdir -p $fontDir $docDir
-    install -Dm644 README.md $docDir
-    install -t $fontDir -m644 'Fonts/Office Code Pro/OTF/'*.otf
-    install -t $fontDir -m644 'Fonts/Office Code Pro D/OTF/'*.otf
+  postFetch = ''
+    tar xf $downloadedFile --strip=1
+    install -m644 -Dt $out/share/doc/${name} README.md
+    install -m444 -Dt $out/share/fonts/opentype 'Fonts/Office Code Pro/OTF/'*.otf 'Fonts/Office Code Pro D/OTF/'*.otf
   '';
+  sha256 = "1bagwcaicn6q8qkqazz6wb3x30y4apmkga0mkv8fh6890hfhywr9";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A customized version of Source Code Pro";
     longDescription = ''
       Office Code Pro is a customized version of Source Code Pro, the monospaced
@@ -31,6 +28,5 @@ stdenv.mkDerivation rec {
     homepage = https://github.com/nathco/Office-Code-Pro;
     license = licenses.ofl;
     maintainers = [ maintainers.AndersonTorres ];
-    platforms = platforms.unix;
   };
 }