2020-11-06 00:33:48 +00:00
|
|
|
{ stdenv, lib, fetchurl, iosevka, unzip
|
2020-11-03 02:18:15 +00:00
|
|
|
, variant ? ""
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2020-11-03 02:18:15 +00:00
|
|
|
name = "iosevka" + lib.optionalString (variant != "") "-" + variant;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-03 02:18:15 +00: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";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-03 02:18:15 +00: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 = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/share/fonts
|
2020-11-03 02:18:15 +00:00
|
|
|
unzip -d $out/share/fonts/truetype $src
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
meta = iosevka.meta // {
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
cstrahan
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-11-03 02:18:15 +00:00
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
passthru.updateScript = ./update-bin.sh;
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|