2021-04-06 15:06:58 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchzip
|
|
|
|
, python3
|
|
|
|
, config
|
|
|
|
, acceptLicense ? config.input-fonts.acceptLicense or false
|
|
|
|
}:
|
2016-10-08 16:00:08 +02:00
|
|
|
|
2021-04-06 15:06:58 +02:00
|
|
|
let
|
2016-10-08 16:00:08 +02:00
|
|
|
|
2021-04-06 15:06:58 +02:00
|
|
|
throwLicense = throw ''
|
|
|
|
Input is available free of charge for private/unpublished usage. This includes things like your personal coding app or for composing plain text documents.
|
|
|
|
To use it, you need to agree to its license: https://input.djr.com/license/
|
|
|
|
|
|
|
|
You can express acceptance by setting acceptLicense to true in your
|
|
|
|
configuration. Note that this is not a free license so it requires allowing
|
|
|
|
unfree licenses.
|
|
|
|
|
|
|
|
configuration.nix:
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
nixpkgs.config.input-fonts.acceptLicense = true;
|
|
|
|
|
|
|
|
config.nix:
|
|
|
|
allowUnfree = true;
|
|
|
|
input-fonts.acceptLicense = true;
|
|
|
|
|
|
|
|
If you would like to support this project, consider purchasing a license at <http://input.djr.com/buy>.
|
|
|
|
'';
|
2016-10-08 16:00:08 +02:00
|
|
|
|
2021-04-06 15:06:58 +02:00
|
|
|
releaseDate = "2015-06-24";
|
2016-10-08 16:00:08 +02:00
|
|
|
|
2021-04-06 15:06:58 +02:00
|
|
|
in
|
2016-10-08 16:00:08 +02:00
|
|
|
|
2021-04-06 15:06:58 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "input-fonts";
|
|
|
|
version = "1.2";
|
|
|
|
|
|
|
|
src =
|
|
|
|
assert !acceptLicense -> throwLicense;
|
|
|
|
fetchzip {
|
|
|
|
name = "input-fonts-${version}";
|
|
|
|
# Add .zip parameter so that zip unpackCmd can match it.
|
|
|
|
url = "https://input.djr.com/build/?fontSelection=whole&a=0&g=0&i=0&l=0&zero=0&asterisk=0&braces=0&preset=default&line-height=1.2&accept=I+do&email=&.zip";
|
|
|
|
sha256 = "BESZ4Bjgm2hvQ7oPpMvYSlE8EqvQjqHZtXWIovqyIzA=";
|
|
|
|
stripRoot = false;
|
|
|
|
|
|
|
|
extraPostFetch = ''
|
|
|
|
# Reset the timestamp to release date for determinism.
|
|
|
|
PATH=${lib.makeBinPath [ python3.pkgs.fonttools ]}:$PATH
|
|
|
|
for ttf_file in $out/Input_Fonts/*/*/*.ttf; do
|
|
|
|
ttx_file=$(dirname "$ttf_file")/$(basename "$ttf_file" .ttf).ttx
|
|
|
|
ttx "$ttf_file"
|
|
|
|
rm "$ttf_file"
|
|
|
|
touch -m -t ${builtins.replaceStrings [ "-" ] [ "" ] releaseDate}0000 "$ttx_file"
|
|
|
|
ttx --recalc-timestamp "$ttx_file"
|
|
|
|
rm "$ttx_file"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
2016-10-08 16:00:08 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-06 15:06:58 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
2016-10-08 16:00:08 +02:00
|
|
|
mkdir -p $out/share/fonts/truetype
|
|
|
|
find Input_Fonts -name "*.ttf" -exec cp -a {} "$out"/share/fonts/truetype/ \;
|
|
|
|
mkdir -p "$out"/share/doc
|
|
|
|
cp -a *.txt "$out"/share/doc/
|
|
|
|
|
2021-04-06 15:06:58 +02:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2017-08-10 21:43:49 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2016-10-08 16:00:08 +02:00
|
|
|
description = "Fonts for Code, from Font Bureau";
|
2017-12-05 23:20:11 +01:00
|
|
|
longDescription = ''
|
2016-10-08 16:00:08 +02:00
|
|
|
Input is a font family designed for computer programming, data,
|
|
|
|
and text composition. It was designed by David Jonathan Ross
|
|
|
|
between 2012 and 2014 and published by The Font Bureau. It
|
|
|
|
contains a wide array of styles so you can fine-tune the
|
|
|
|
typography that works best in your editing environment.
|
|
|
|
|
|
|
|
Input Mono is a monospaced typeface, where all characters occupy
|
|
|
|
a fixed width. Input Sans and Serif are proportional typefaces
|
|
|
|
that are designed with all of the features of a good monospace —
|
|
|
|
generous spacing, large punctuation, and easily distinguishable
|
|
|
|
characters — but without the limitations of a fixed width.
|
|
|
|
'';
|
2021-04-06 15:06:58 +02:00
|
|
|
homepage = "https://input.djr.com/";
|
2016-10-09 05:01:34 +02:00
|
|
|
license = licenses.unfree;
|
2021-04-06 15:06:58 +02:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
jtojnar
|
|
|
|
romildo
|
|
|
|
];
|
2016-10-08 16:00:08 +02:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|