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.hostPlatform.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;
51 # 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'
55 # Fix build with Rust 1.80; remove on next release
56 ln -sf ${./Cargo.lock} Cargo.lock
60 installManPage crates/typst-cli/artifacts/*.1
61 installShellCompletion \
62 crates/typst-cli/artifacts/typst.{bash,fish} \
63 --zsh crates/typst-cli/artifacts/_typst
66 cargoTestFlags = [ "--workspace" ];
68 passthru.updateScript = nix-update-script { };
71 changelog = "https://github.com/typst/typst/releases/tag/${src.rev}";
72 description = "New markup-based typesetting system that is powerful and easy to learn";
73 homepage = "https://github.com/typst/typst";
74 license = lib.licenses.asl20;
75 mainProgram = "typst";
76 maintainers = with lib.maintainers; [ drupol figsoda kanashimia ];