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
|
2021-09-18 10:52:07 +00:00
|
|
|
name = if lib.hasPrefix "sgr" variant then variant
|
|
|
|
else "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";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "17.0.2";
|
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 ];
|
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
dontInstall = true;
|
2020-11-03 02:18:15 +00:00
|
|
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
meta = {
|
|
|
|
inherit (iosevka.meta) homepage downloadPage description license platforms;
|
2020-11-06 00:33:48 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
cstrahan
|
2022-12-17 10:02:37 +00:00
|
|
|
montchr
|
2020-11-06 00:33:48 +00:00
|
|
|
];
|
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
|
|
|
}
|