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