mirror of
https://github.com/ryanccn/flake.git
synced 2026-01-26 19:56:29 +01:00
feat: reorganize, update
This commit is contained in:
parent
eb6b664802
commit
872c6be493
10 changed files with 140 additions and 139 deletions
|
|
@ -1,23 +1,21 @@
|
|||
{
|
||||
ibm-plex,
|
||||
fd,
|
||||
python312Packages,
|
||||
families ? [ ],
|
||||
}:
|
||||
ibm-plex.overrideAttrs (_: {
|
||||
(ibm-plex.override { inherit families; }).overrideAttrs (_: {
|
||||
pname = "ibm-plex-compat";
|
||||
|
||||
postInstall = ''
|
||||
set -eo pipefail
|
||||
PATH="${fd}/bin:${python312Packages.fonttools}/bin:$PATH"
|
||||
PATH="${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
|
||||
for medium_font in $(find . -type f -name '*.otf' -and -name '*Medium*'); do
|
||||
echo -e "''${ansi_green}Patching''${ansi_reset} $medium_font (Medm -> Medium)"
|
||||
|
||||
ttx_path="''${medium_font%.*}.ttx"
|
||||
|
|
@ -28,9 +26,7 @@ ibm-plex.overrideAttrs (_: {
|
|||
rm "$ttx_path"
|
||||
done
|
||||
|
||||
semibold_fonts=$(fd --extension=otf SemiBold)
|
||||
|
||||
for semibold_font in $semibold_fonts; do
|
||||
for semibold_font in $(find . -type f -name '*.otf' -and -name '*SemiBold*'); do
|
||||
echo -e "''${ansi_green}Patching''${ansi_reset} $semibold_font (SmBld -> Semibold)"
|
||||
|
||||
ttx_path="''${semibold_font%.*}.ttx"
|
||||
|
|
|
|||
|
|
@ -1,63 +1,43 @@
|
|||
{
|
||||
callPackage,
|
||||
symlinkJoin,
|
||||
lib,
|
||||
stdenvNoCC,
|
||||
fetchzip,
|
||||
}:
|
||||
let
|
||||
version = "2024.05.26";
|
||||
version = "2024.11.18";
|
||||
|
||||
mkFontVariant =
|
||||
{ variant, hash }:
|
||||
callPackage (
|
||||
{
|
||||
lib,
|
||||
fetchzip,
|
||||
stdenvNoCC,
|
||||
}:
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = variant;
|
||||
inherit version;
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://github.com/ryanccn/ryan-mono/releases/download/v${version}/${variant}.tar.xz";
|
||||
inherit hash;
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dm644 *.ttf -t $out/share/fonts/truetype
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/ryanccn/ryan-mono";
|
||||
platforms = platforms.all;
|
||||
license = licenses.ofl;
|
||||
};
|
||||
}
|
||||
) { };
|
||||
hashes = {
|
||||
"RyanMono" = "sha256-c+NRiWMMZEmX2ImFpvSboPEKYPuBahYsjAzddsYi1Lo=";
|
||||
"RyanTerm" = "sha256-uYqK1ktgZPbhAOX3FyFWKDUSBDBQX6KtepT3PGcGuB0=";
|
||||
# "RyanMonoNerdFont" = "sha256-CKBgRHXw6U3PjXruHCE+YsksHn+hJGjwWwtS9CbGcXg=";
|
||||
# "RyanTermNerdFont" = "sha256-4GYYuZ//Ekk7jNi2zjxTMziaOOx4f2K17xcYIzOYAWc=";
|
||||
};
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "ryan-mono-bin-${version}";
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "ryan-mono-bin";
|
||||
inherit version;
|
||||
|
||||
paths = [
|
||||
(mkFontVariant {
|
||||
variant = "RyanMono";
|
||||
hash = "sha256-smlvBfpwVoD0qfmmHcJjsLdiblXjy5eevZfK4qDc9x8=";
|
||||
})
|
||||
srcs = lib.mapAttrsToList (
|
||||
family: hash:
|
||||
fetchzip {
|
||||
url = "https://github.com/ryanccn/ryan-mono/releases/download/v${version}/${family}.tar.xz";
|
||||
inherit hash;
|
||||
}
|
||||
) hashes;
|
||||
|
||||
(mkFontVariant {
|
||||
variant = "RyanTerm";
|
||||
hash = "sha256-12xaJqgR5R6SZnZ7vJeD5zg2TZbWEiUrdyK+ljekMvc=";
|
||||
})
|
||||
sourceRoot = ".";
|
||||
dontUnpack = true;
|
||||
|
||||
(mkFontVariant {
|
||||
variant = "RyanMonoNerdFont";
|
||||
hash = "sha256-n2d9K1rJuWCF2NgkRLQQCNCAxYfiBVv/jpn+BzqBvAI=";
|
||||
})
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
find $srcs -type f -name '*.ttf' -exec install -Dm644 {} -t $out/share/fonts/truetype \;
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
(mkFontVariant {
|
||||
variant = "RyanTermNerdFont";
|
||||
hash = "sha256-yrzgNRD560FhHLSK1neHVSnB+ZiHP2bmKzD1pGTu9Ro=";
|
||||
})
|
||||
];
|
||||
meta = with lib; {
|
||||
description = "Ryan's homemade Iosevka build";
|
||||
homepage = "https://github.com/ryanccn/ryan-mono";
|
||||
platforms = platforms.all;
|
||||
license = licenses.ofl;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue