2020-11-04 10:45:44 +00:00
|
|
|
{ stdenv, lib, fetchurl, iosevka, unzip
|
2020-05-21 23:44:58 +01:00
|
|
|
, variant ? ""
|
|
|
|
}:
|
2017-11-27 12:34:31 +00:00
|
|
|
|
|
|
|
let
|
2020-05-21 23:44:58 +01:00
|
|
|
name = "iosevka" + lib.optionalString (variant != "") "-" + variant;
|
2017-11-27 12:34:31 +00:00
|
|
|
|
2020-05-21 23:44:58 +01:00
|
|
|
variantHashes = import ./variants.nix;
|
|
|
|
validVariants = map (lib.removePrefix "iosevka-")
|
|
|
|
(builtins.attrNames (builtins.removeAttrs variantHashes [ "iosevka" ]));
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "${name}-bin";
|
2021-07-28 08:08:59 +01:00
|
|
|
version = "8.0.2";
|
2017-11-27 12:34:31 +00:00
|
|
|
|
2020-05-21 23:44:58 +01: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 ];
|
|
|
|
|
2021-07-22 13:04:25 +01:00
|
|
|
dontInstall = true;
|
2020-05-21 23:44:58 +01:00
|
|
|
|
|
|
|
unpackPhase = ''
|
2017-11-27 12:34:31 +00:00
|
|
|
mkdir -p $out/share/fonts
|
2020-05-21 23:44:58 +01:00
|
|
|
unzip -d $out/share/fonts/truetype $src
|
2017-11-27 12:34:31 +00:00
|
|
|
'';
|
|
|
|
|
2020-11-04 10:45:44 +00:00
|
|
|
meta = iosevka.meta // {
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
cstrahan
|
|
|
|
];
|
2017-11-27 12:34:31 +00:00
|
|
|
};
|
2020-05-21 23:44:58 +01:00
|
|
|
|
2020-10-31 01:16:26 +00:00
|
|
|
passthru.updateScript = ./update-bin.sh;
|
2017-11-27 12:34:31 +00:00
|
|
|
}
|