Skip to content

Commit

Permalink
typst: add cetz package for typst
Browse files Browse the repository at this point in the history
  • Loading branch information
cherrypiejam committed Jan 7, 2025
1 parent d6e1592 commit 8043a85
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
46 changes: 46 additions & 0 deletions pkgs/development/typst-packages/cetz.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
lib,
buildTypstPackage,
fetchFromGitHub,
just,
file,
perl,
}:

buildTypstPackage rec {
pname = "cetz";
version = "0.2.2";

src = fetchFromGitHub {
owner = "cetz-package";
repo = "cetz";
tag = "v${version}";
hash = "sha256-5+Np64+0Ca8yL7D1CCUewF03Wh6BM2bV1BQNUA+bW74=";
fetchSubmodules = true;
};

nativeBuildInputs = [
just
perl
];

prePatch = ''
patchShebangs --build scripts/package
'';

buildPhase = ''
export BUILD_DIR=$(mktemp -d)
just install $BUILD_DIR
'';

preInstall = ''
rm -rf *
cp -r $BUILD_DIR/cetz/${version}/* .
'';

meta = {
homepage = "https://github.com/cetz-package/cetz";
description = "A library for drawing stuff with Typst";
license = lib.licenses.asl20;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/typst-packages.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{ callPackage }:

{
cetz = callPackage ../development/typst-packages/cetz.nix { };

polylux = callPackage ../development/typst-packages/polylux.nix { };
}

0 comments on commit 8043a85

Please sign in to comment.