vendor ibm-plex

i don't like how we're doing this lol. setting the IBM_PLEX_WEB env var feels wrong.
This commit is contained in:
2026-02-03 07:38:09 -07:00
parent b7ae1fb178
commit cc9c74ed64
5 changed files with 58 additions and 2 deletions

View File

@@ -1,15 +1,34 @@
{ mkCljBin
, callPackage
, doerg-parser
, ibm-plex-web
, fake-git
}:
mkCljBin {
let
# mkCljBin sans fake-git.
mkCljBin' = args: (mkCljBin args).overrideAttrs (final: prev: {
nativeBuildInputs =
builtins.filter
# A possibly-sketchy predicate, lol.
(x: x != fake-git)
prev.nativeBuildInputs;
});
plex = ibm-plex-web.override {
families = [ "math" "serif" "sans-kr" ];
};
in mkCljBin' {
name = "net.deertopia/doerg";
version = "0.1.0";
projectSrc = ./.;
lockfile = ../deps-lock.json;
main-ns = "net.deertopia.doerg.main";
nativeBuildInputs = [
plex
];
buildInputs = [
doerg-parser
plex
];
}

View File

@@ -3,6 +3,7 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
clj-nix.url = "github:jlesquembre/clj-nix";
# clj-nix.url = "path:///home/msyds/git/clj-nix";
};
outputs = { self, nixpkgs, clj-nix, ... }@inputs:
@@ -36,7 +37,9 @@
overlays.default = final: prev:
let graal = x: final.mkGraalBin { cljDrv = x; };
in rec {
vendored = final.callPackage ./vendor {};
in {
inherit (vendored) ibm-plex-web;
publisher = final.callPackage ./publisher/package.nix {};
doerg = final.callPackage ./doerg/package.nix {};
doerg-parser = final.callPackage ./doerg/doerg-parser/package.nix {};
@@ -51,9 +54,13 @@
devShells = each-system ({ pkgs, system, ... }: {
default = pkgs.mkShell {
inputsFrom = [ pkgs.doerg ];
packages = with pkgs; [
clojure-lsp
doerg-parser
# wahhh ibm-plex-web is a dependency of doerg... why must
# i specify it hereeee.
# ibm-plex-web
zprint
clojure
babashka

1
repl-result-out Symbolic link
View File

@@ -0,0 +1 @@
/nix/store/y795rs13pvpzlc7ci4v8b447srsn38xc-nix-shell

8
vendor/default.nix vendored Normal file
View File

@@ -0,0 +1,8 @@
{ fetchzip
, fetchurl
, callPackage
}:
{
ibm-plex-web = callPackage ./ibm-plex-web.nix {};
}

21
vendor/ibm-plex-web.nix vendored Normal file
View File

@@ -0,0 +1,21 @@
# Differs from the Nixpkgs distribution in that we distribute WOFFs
# and CSS rather than just OTF.
{ ibm-plex
, families ? []
}@args:
(ibm-plex.overrideAttrs (_prev: {
installPhase = ''
runHook preInstall
for i in $srcs; do
# cp $i/css/*.css $out/css
for j in css fonts/{complete,split}/{woff,woff2}; do
if [ -d $i/$j ]; then
find $i/$j -type f -regex '.*\.\(woff2?\|css\)' \
-exec install -Dm644 -t $out/share/ibm-plex-web/$j {} \;
fi
done
done
runHook postInstall
'';
})).override { inherit families; }