2020-11-04 10:45:44 +00:00
|
|
|
{ stdenv, lib, fetchurl, iosevka, unzip
|
2020-05-21 22:44:58 +00:00
|
|
|
, variant ? ""
|
|
|
|
}:
|
2017-11-27 12:34:31 +00:00
|
|
|
|
|
|
|
let
|
2021-09-07 20:02:28 +00:00
|
|
|
name = if lib.hasPrefix "sgr" variant then variant
|
|
|
|
else "iosevka" + lib.optionalString (variant != "") "-" + variant;
|
2017-11-27 12:34:31 +00:00
|
|
|
|
2020-05-21 22:44:58 +00:00
|
|
|
variantHashes = import ./variants.nix;
|
|
|
|
validVariants = map (lib.removePrefix "iosevka-")
|
|
|
|
(builtins.attrNames (builtins.removeAttrs variantHashes [ "iosevka" ]));
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "${name}-bin";
|
2023-09-20 06:36:46 +00:00
|
|
|
version = "27.0.1";
|
2017-11-27 12:34:31 +00:00
|
|
|
|
2020-05-21 22:44:58 +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 ];
|
|
|
|
|
2021-07-22 12:04:25 +00:00
|
|
|
dontInstall = true;
|
2020-05-21 22:44:58 +00:00
|
|
|
|
|
|
|
unpackPhase = ''
|
2017-11-27 12:34:31 +00:00
|
|
|
mkdir -p $out/share/fonts
|
2020-05-21 22:44:58 +00:00
|
|
|
unzip -d $out/share/fonts/truetype $src
|
2017-11-27 12:34:31 +00:00
|
|
|
'';
|
|
|
|
|
2022-03-07 04:22:38 +00:00
|
|
|
meta = {
|
|
|
|
inherit (iosevka.meta) homepage downloadPage description license platforms;
|
2020-11-04 10:45:44 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
cstrahan
|
2022-11-21 05:00:35 +00:00
|
|
|
montchr
|
2020-11-04 10:45:44 +00:00
|
|
|
];
|
2017-11-27 12:34:31 +00:00
|
|
|
};
|
2020-05-21 22:44:58 +00:00
|
|
|
|
2020-10-31 01:16:26 +00:00
|
|
|
passthru.updateScript = ./update-bin.sh;
|
2017-11-27 12:34:31 +00:00
|
|
|
}
|