mirror of
https://github.com/ryanccn/flake.git
synced 2025-12-06 08:10:43 +01:00
treewide: refactor, nix, overlays -> packages
This commit is contained in:
parent
d6238e12af
commit
eb6b664802
23 changed files with 240 additions and 308 deletions
46
packages/ibm-plex-compat.nix
Normal file
46
packages/ibm-plex-compat.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
ibm-plex,
|
||||
fd,
|
||||
python312Packages,
|
||||
}:
|
||||
ibm-plex.overrideAttrs (_: {
|
||||
pname = "ibm-plex-compat";
|
||||
|
||||
postInstall = ''
|
||||
set -eo pipefail
|
||||
PATH="${fd}/bin:${python312Packages.fonttools}/bin:$PATH"
|
||||
|
||||
cd "$out/share/fonts/opentype"
|
||||
|
||||
ansi_green="\033[32m"
|
||||
ansi_reset="\033[0m"
|
||||
|
||||
medium_fonts=$(fd --extension=otf Medium)
|
||||
|
||||
for medium_font in $medium_fonts; do
|
||||
echo -e "''${ansi_green}Patching''${ansi_reset} $medium_font (Medm -> Medium)"
|
||||
|
||||
ttx_path="''${medium_font%.*}.ttx"
|
||||
|
||||
ttx "$medium_font"
|
||||
substituteInPlace "$ttx_path" --replace-fail 'Medm' 'Medium'
|
||||
ttx -f "$ttx_path"
|
||||
rm "$ttx_path"
|
||||
done
|
||||
|
||||
semibold_fonts=$(fd --extension=otf SemiBold)
|
||||
|
||||
for semibold_font in $semibold_fonts; do
|
||||
echo -e "''${ansi_green}Patching''${ansi_reset} $semibold_font (SmBld -> Semibold)"
|
||||
|
||||
ttx_path="''${semibold_font%.*}.ttx"
|
||||
|
||||
ttx "$semibold_font"
|
||||
substituteInPlace "$ttx_path" --replace-fail 'SmBld' 'Semibold'
|
||||
ttx -f "$ttx_path"
|
||||
rm "$ttx_path"
|
||||
done
|
||||
|
||||
echo -e "''${ansi_green}Done!''${ansi_reset}"
|
||||
'';
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue