From cc9c74ed64a1f8e9c0a035cf7f55c8693f1f7b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Tue, 3 Feb 2026 07:38:09 -0700 Subject: [PATCH] vendor ibm-plex i don't like how we're doing this lol. setting the IBM_PLEX_WEB env var feels wrong. --- doerg/package.nix | 21 ++++++++++++++++++++- flake.nix | 9 ++++++++- repl-result-out | 1 + vendor/default.nix | 8 ++++++++ vendor/ibm-plex-web.nix | 21 +++++++++++++++++++++ 5 files changed, 58 insertions(+), 2 deletions(-) create mode 120000 repl-result-out create mode 100644 vendor/default.nix create mode 100644 vendor/ibm-plex-web.nix diff --git a/doerg/package.nix b/doerg/package.nix index 33a4b9a..be8ffee 100644 --- a/doerg/package.nix +++ b/doerg/package.nix @@ -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 ]; } diff --git a/flake.nix b/flake.nix index a14a874..d00a376 100644 --- a/flake.nix +++ b/flake.nix @@ -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 diff --git a/repl-result-out b/repl-result-out new file mode 120000 index 0000000..31c26ce --- /dev/null +++ b/repl-result-out @@ -0,0 +1 @@ +/nix/store/y795rs13pvpzlc7ci4v8b447srsn38xc-nix-shell \ No newline at end of file diff --git a/vendor/default.nix b/vendor/default.nix new file mode 100644 index 0000000..af2f076 --- /dev/null +++ b/vendor/default.nix @@ -0,0 +1,8 @@ +{ fetchzip +, fetchurl +, callPackage +}: + +{ + ibm-plex-web = callPackage ./ibm-plex-web.nix {}; +} diff --git a/vendor/ibm-plex-web.nix b/vendor/ibm-plex-web.nix new file mode 100644 index 0000000..84b46dc --- /dev/null +++ b/vendor/ibm-plex-web.nix @@ -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; }