Import the whole iosevka

This commit is contained in:
Martin Potier 2019-09-25 12:28:52 +03:00
parent 2ed577032f
commit b99d947a5e
No known key found for this signature in database
GPG Key ID: D4DD957DBA4AD89E
5 changed files with 150 additions and 37 deletions

View File

@ -5,7 +5,7 @@ self: super:
{
qutebrowserWE = super.qutebrowser.override { withWebEngineDefault = true; };
iosevka-hskl = super.iosevka.override {
iosevka-hskl = super.callPackage ./iosevka {
privateBuildPlan = {
family = "Iosevka Samae";
design = [

28
pkgs/iosevka/bin.nix Normal file
View File

@ -0,0 +1,28 @@
{ stdenv, fetchzip }:
let
version = "2.3.0";
in fetchzip {
name = "iosevka-bin-${version}";
url = "https://github.com/be5invis/Iosevka/releases/download/v${version}/ttc-iosevka-${version}.zip";
postFetch = ''
mkdir -p $out/share/fonts
unzip -j $downloadedFile \*.ttc -d $out/share/fonts/iosevka
'';
sha256 = "0nry6zsmvcj44rijhbvrry84rh5hrixzb4n1mx9c27vvpy33a56w";
meta = with stdenv.lib; {
homepage = https://be5invis.github.io/Iosevka/;
downloadPage = "https://github.com/be5invis/Iosevka/releases";
description = ''
Slender monospace sans-serif and slab-serif typeface inspired by Pragmata
Pro, M+ and PF DIN Mono, designed to be the ideal font for programming.
'';
license = licenses.ofl;
platforms = platforms.all;
maintainers = [ maintainers.cstrahan ];
};
}

95
pkgs/iosevka/default.nix Normal file
View File

@ -0,0 +1,95 @@
{ stdenv, lib, pkgs, fetchFromGitHub
, nodejs, nodePackages, remarshal, ttfautohint-nox, otfcc
# Custom font set options.
# See https://github.com/be5invis/Iosevka#build-your-own-style
# Ex:
# privateBuildPlan = {
# family = "Iosevka Expanded";
#
# design = [
# "sans"
# "expanded"
# ];
# };
, privateBuildPlan ? null
# Extra parameters. Can be used for ligature mapping.
, extraParameters ? null
# Custom font set name. Required if any custom settings above.
, set ? null
}:
assert (privateBuildPlan != null) -> set != null;
stdenv.mkDerivation rec {
pname =
if set != null
then "iosevka-${set}"
else "iosevka";
version = "2.3.0";
src = fetchFromGitHub {
owner = "be5invis";
repo = "Iosevka";
rev = "v${version}";
sha256 = "1qnbxhx9wvij9zia226mc3sy8j7bfsw5v1cvxvsbbwjskwqdamvv";
};
nativeBuildInputs = [
nodejs
nodePackages."iosevka-build-deps-../../data/fonts/iosevka"
remarshal
otfcc
ttfautohint-nox
];
privateBuildPlanJSON = builtins.toJSON { buildPlans.${pname} = privateBuildPlan; };
extraParametersJSON = builtins.toJSON { ${pname} = extraParameters; };
passAsFile = [ "privateBuildPlanJSON" "extraParametersJSON" ];
configurePhase = ''
runHook preConfigure
${lib.optionalString (privateBuildPlan != null) ''
remarshal -i "$privateBuildPlanJSONPath" -o private-build-plans.toml -if json -of toml
''}
${lib.optionalString (extraParameters != null) ''
echo -e "\n" >> parameters.toml
remarshal -i "$extraParametersJSONPath" -if json -of toml >> parameters.toml
''}
ln -s ${nodePackages."iosevka-build-deps-../../data/fonts/iosevka"}/lib/node_modules/iosevka-build-deps/node_modules .
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
npm run build -- ttf::$pname
runHook postBuild
'';
installPhase = ''
fontdir="$out/share/fonts/$pname"
install -d "$fontdir"
install "dist/$pname/ttf"/* "$fontdir"
'';
enableParallelBuilding = true;
meta = with stdenv.lib; {
homepage = https://be5invis.github.io/Iosevka;
downloadPage = https://github.com/be5invis/Iosevka/releases;
description = ''
Slender monospace sans-serif and slab-serif typeface inspired by Pragmata
Pro, M+ and PF DIN Mono, designed to be the ideal font for programming.
'';
license = licenses.ofl;
platforms = platforms.all;
maintainers = with maintainers; [
cstrahan
jfrankenau
ttuegel
babariviere
rileyinman
];
};
}

26
pkgs/iosevka/package.json Normal file
View File

@ -0,0 +1,26 @@
{
"name": "iosevka-build-deps",
"version": "2.3.0",
"scripts": {
"build": "verda -f verdafile.js"
},
"dependencies": {
"caryll-shapeops": "^0.3.1",
"colors": "^1.3.3",
"libspiro-js": "^0.3.1",
"megaminx": "^0.9.0",
"object-assign": "^4.1.1",
"otfcc-ttcize": "^0.8.0",
"patel": "^0.33.1",
"patrisika-scopes": "^0.11.1",
"primitive-quadify-off-curves": "^0.4.0",
"stylus": "^0.54.5",
"toml": "^2.3.2",
"topsort": "0.0.2",
"ttf2woff": "^2.0.1",
"ttf2woff2": "^2.0.3",
"unorm": "^1.4.1",
"verda": "^1.0.0-0",
"yargs": "^12.0.0"
}
}

View File

@ -1,36 +0,0 @@
{ stdenv, fetchgit, makeWrapper, qtbase, qmake
, qtdeclarative, qttools, qtx11extras, mpv, linuxHeaders
, withAPIKey ? "AIzaSyAHj2NywPI-GhV_yMgCDjE7XFGAnPrJDGM" }:
stdenv.mkDerivation rec {
name = "minitube-${version}";
version = "3.1";
# Have to use fetchgit to import submodules :(
src = fetchgit {
url = "https://github.com/flaviotordini/minitube.git";
rev = "refs/tags/${version}";
deepClone = true;
sha256 = "1hm2bwlma2d4rz0sff7axygsj67inghliadhfzv4hdp7pcz8g59x";
};
buildInputs = [ qtbase qtdeclarative qttools qtx11extras mpv linuxHeaders ];
nativeBuildInputs = [ makeWrapper qmake ];
qmakeFlags = [ "DEFINES+=APP_GOOGLE_API_KEY=${withAPIKey}" ];
enableParallelBuilding = true;
meta = with stdenv.lib; {
description = "Stand-alone YouTube video player";
longDescription = ''
Watch YouTube videos in a new way: you type a keyword, Minitube gives
you an endless video stream. Minitube is not about cloning the YouTube
website, it aims to create a new TV-like experience.
'';
homepage = https://flavio.tordini.org/minitube;
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ jpotier ];
};
}