13 rustPlatform.buildRustPackage rec {
17 src = fetchFromGitHub {
21 hash = "sha256-FagjVU8BJZStE/geexZERuV2P28iF/pPn2mTi1Gu9iU=";
25 lockFile = ./Cargo.lock;
27 "typst-dev-assets-0.11.1" = "sha256-SMRtitDHFpdMEoOuPBnC3RBTyZ96hb4KmMSCXpAyKfU=";
39 ] ++ lib.optionals stdenv.isDarwin [
40 darwin.apple_sdk.frameworks.CoreFoundation
41 darwin.apple_sdk.frameworks.CoreServices
42 darwin.apple_sdk.frameworks.Security
46 GEN_ARTIFACTS = "artifacts";
47 OPENSSL_NO_VENDOR = true;
50 # Fix for "Found argument '--test-threads' which wasn't expected, or isn't valid in this context"
52 substituteInPlace tests/src/tests.rs --replace-fail 'ARGS.num_threads' 'ARGS.test_threads'
53 substituteInPlace tests/src/args.rs --replace-fail 'num_threads' 'test_threads'
57 installManPage crates/typst-cli/artifacts/*.1
58 installShellCompletion \
59 crates/typst-cli/artifacts/typst.{bash,fish} \
60 --zsh crates/typst-cli/artifacts/_typst
63 cargoTestFlags = [ "--workspace" ];
65 passthru.updateScript = nix-update-script { };
68 changelog = "https://github.com/typst/typst/releases/tag/${src.rev}";
69 description = "New markup-based typesetting system that is powerful and easy to learn";
70 homepage = "https://github.com/typst/typst";
71 license = lib.licenses.asl20;
72 mainProgram = "typst";
73 maintainers = with lib.maintainers; [ drupol figsoda kanashimia ];