Files
nixpkgs/pkgs/by-name/ty/typst/with-packages.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

35 lines
743 B
Nix

{
lib,
buildEnv,
typstPackages,
makeBinaryWrapper,
typst,
}:
lib.makeOverridable (
{ ... }@typstPkgs:
f:
buildEnv {
inherit (typst) meta;
name = "${typst.name}-env";
paths = lib.foldl' (acc: p: acc ++ lib.singleton p ++ p.propagatedBuildInputs) [ ] (f typstPkgs);
pathsToLink = [ "/lib/typst-packages" ];
nativeBuildInputs = [ makeBinaryWrapper ];
postBuild = ''
export TYPST_LIB_DIR="$out/lib/typst/packages"
mkdir -p $TYPST_LIB_DIR
mv $out/lib/typst-packages $TYPST_LIB_DIR/preview
cp -r ${typst}/share $out/share
mkdir -p $out/bin
makeWrapper "${lib.getExe typst}" "$out/bin/typst" --set TYPST_PACKAGE_CACHE_PATH $TYPST_LIB_DIR
'';
}
) typstPackages