forked from mirrors/nixpkgs
b1f74dd413
* iosevka: 5.0.2 -> 7.0.4 * iosevka-bin: 5.0.5 -> 7.0.4
40 lines
1,006 B
Nix
40 lines
1,006 B
Nix
{ stdenv, lib, fetchurl, iosevka, unzip
|
|
, variant ? ""
|
|
}:
|
|
|
|
let
|
|
name = "iosevka" + lib.optionalString (variant != "") "-" + variant;
|
|
|
|
variantHashes = import ./variants.nix;
|
|
validVariants = map (lib.removePrefix "iosevka-")
|
|
(builtins.attrNames (builtins.removeAttrs variantHashes [ "iosevka" ]));
|
|
in stdenv.mkDerivation rec {
|
|
pname = "${name}-bin";
|
|
version = "7.0.4";
|
|
|
|
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 = ''
|
|
mkdir -p $out/share/fonts
|
|
unzip -d $out/share/fonts/truetype $src
|
|
'';
|
|
|
|
meta = iosevka.meta // {
|
|
maintainers = with lib.maintainers; [
|
|
cstrahan
|
|
];
|
|
};
|
|
|
|
passthru.updateScript = ./update-bin.sh;
|
|
}
|