fonts/flake.nix

181 lines
4.9 KiB
Nix
Raw Permalink Normal View History

2023-09-10 02:59:56 +00:00
{
description = "Various fonts I've found online";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
artemist = {
url = "git+https://git.mildlyfunctional.gay/artemist/packages.git";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-09-10 02:59:56 +00:00
};
2024-07-15 19:30:45 +00:00
outputs =
{
self,
nixpkgs,
artemist,
}:
2023-09-10 02:59:56 +00:00
with nixpkgs.lib;
2024-07-15 19:53:04 +00:00
let
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
makePkgs =
system:
import nixpkgs {
inherit system;
overlays = [
self.overlays.default
artemist.overlays.default
];
config.allowUnfree = true;
};
localFonts = [
{
# Popular font, used on NYC Subway
name = "Akzidenz-Grotesk Pro";
dir = ./Akzidenz-Grotesk-Pro;
license = licenses.unfree;
author = "Berthold Type Foundry";
}
{
# Font used on DSB departure boards
name = "AtB";
dir = ./AtB;
license = licenses.unfree;
author = "Kontrapunkt";
}
{
# Brussels-specific font
name = "Brusseline";
dir = ./Brusseline;
license = licenses.unfree;
author = "Eric de Berranger";
}
{
# Free handwriting font
name = "Caveat";
files = [ ./Caveat.ttf ];
license = licenses.ofl;
author = "Pablo Impallari and Alexi Vanyashin";
}
{
# Twitter custom font, based on GT America
name = "Chirp";
dir = ./Chirp;
license = licenses.unfree;
author = "Grilli Type Foundry";
}
{
# Deutsche Bahn website font
name = "DB Screen";
dir = ./DB-Screen;
license = licenses.unfree;
author = "URW Type Foundry";
}
{
# Font with a large number of invented scripts
name = "Fairfax HD";
dir = ./Fairfax-HD;
license = licenses.ofl;
author = "Kreative Software";
}
{
# Popular font, used on Amtrak
name = "Frutiger";
dir = ./Frutiger;
license = licenses.unfree;
author = "Adrian Frutiger";
}
{
# Discord custom font
name = "gg sans";
dir = ./ggsans;
license = licenses.unfree;
author = "Colophon Foundry";
}
{
# Several related fonts used for London Underground:
# * Johnston 100: Extension of original Johnston
# * New Johnston: Modification of original Johnston
# * P22 Underground: Version sold to public
name = "Johnston";
dir = ./Johnston;
license = licenses.unfree;
author = "Edward Johnston et al";
}
{
# Mysterious all-uppercase hand-style font for MIVB/STIB
name = "MIVB STIB";
dir = ./MIVB;
license = licenses.unfree;
author = "unknown";
}
{
# Also called "NR Brunel, used on UK railways in 2010s
name = "New Brunel";
dir = ./New-Brunel;
license = licenses.unfree;
author = "David Quay";
}
{
# Modern expansion of machine-readable font
name = "OCR-B";
files = [ ./OCR-B-Regular.otf ];
license = licenses.cc-by-40;
author = "Matthew Anderson";
}
{
# Custom font used for RATP services in Parism
name = "Parisine";
dir = ./Parisine;
license = licenses.unfree;
author = "Jean-François Porchez";
}
{
# Font used on DSB website, similar to signage
name = "Via";
dir = ./Via;
license = licenses.unfree;
author = "Kontrapunkt";
}
];
in
2023-12-18 03:55:26 +00:00
{
2024-07-15 19:30:45 +00:00
overlays.default = (
final: prev:
2023-12-18 03:55:26 +00:00
let
2024-07-15 19:53:04 +00:00
buildLocalFont = final.callPackage ./nix/buildLocalFont.nix { };
2024-07-15 19:30:45 +00:00
in
{
extraFonts = listToAttrs (
map (font: {
name = replaceStrings [ " " ] [ "-" ] (toLower font.name);
value = buildLocalFont font;
}) localFonts
);
appleFonts = final.callPackage ./apple {
ipsw = if final ? ipsw then final.ipsw else artemist.packages.${final.stdenv.system}.ipsw;
};
2024-07-15 19:30:45 +00:00
}
);
2024-07-15 19:53:04 +00:00
packages = forAllSystems (
system:
builtins.listToAttrs (
2024-07-15 19:30:45 +00:00
map
(name: {
inherit name;
2024-07-15 19:53:04 +00:00
value = (makePkgs system).${name} // {
2024-07-15 19:30:45 +00:00
type = "derivation";
name = "dummy-attrset";
};
})
[
"extraFonts"
"appleFonts"
]
2024-07-15 19:53:04 +00:00
)
);
formatter = forAllSystems (system: (makePkgs system).nixfmt-rfc-style);
};
2023-09-10 02:59:56 +00:00
}