2020-05-22 01:44:58 +03:00
|
|
|
{ stdenv, lib, fetchurl, unzip
|
|
|
|
, variant ? ""
|
|
|
|
}:
|
2017-11-27 15:34:31 +03:00
|
|
|
|
|
|
|
let
|
2020-05-22 01:44:58 +03:00
|
|
|
name = "iosevka" + lib.optionalString (variant != "") "-" + variant;
|
2017-11-27 15:34:31 +03:00
|
|
|
|
2020-05-22 01:44:58 +03:00
|
|
|
variantHashes = import ./variants.nix;
|
|
|
|
validVariants = map (lib.removePrefix "iosevka-")
|
|
|
|
(builtins.attrNames (builtins.removeAttrs variantHashes [ "iosevka" ]));
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "${name}-bin";
|
|
|
|
version = "3.7.1";
|
2017-11-27 15:34:31 +03:00
|
|
|
|
2020-05-22 01:44:58 +03:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/be5invis/Iosevka/releases/download/v${version}/ttc-${name}-${version}.zip";
|
|
|
|
sha256 = variantHashes.${name} or (throw ''
|
|
|
|
No such variant "${variant}" for package iosevka-bin.
|
|
|
|
Valid variants are: ${lib.concatStringsSep ", " validVariants}.
|
|
|
|
'');
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
|
|
|
|
phases = [ "unpackPhase" ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
2017-11-27 15:34:31 +03:00
|
|
|
mkdir -p $out/share/fonts
|
2020-05-22 01:44:58 +03:00
|
|
|
unzip -d $out/share/fonts/truetype $src
|
2017-11-27 15:34:31 +03:00
|
|
|
'';
|
|
|
|
|
2020-05-22 01:44:58 +03:00
|
|
|
meta = with lib; {
|
2020-04-02 23:01:48 +03:00
|
|
|
homepage = "https://be5invis.github.io/Iosevka/";
|
2017-11-27 15:34:31 +03:00
|
|
|
downloadPage = "https://github.com/be5invis/Iosevka/releases";
|
|
|
|
description = ''
|
|
|
|
Slender monospace sans-serif and slab-serif typeface inspired by Pragmata
|
|
|
|
Pro, M+ and PF DIN Mono, designed to be the ideal font for programming.
|
|
|
|
'';
|
|
|
|
license = licenses.ofl;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = [ maintainers.cstrahan ];
|
|
|
|
};
|
2020-05-22 01:44:58 +03:00
|
|
|
|
|
|
|
passthru.updateScript = ./update.sh;
|
2017-11-27 15:34:31 +03:00
|
|
|
}
|