summaryrefslogtreecommitdiff
path: root/pkgs/typst.nix
blob: f505cf5a2819fad189ad7505256f38d9c466c4d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ rustPlatform, fetchFromGitHub, lib, git, rust-bin, ... }:

rustPlatform.buildRustPackage rec {
  pname = "typst-cli";
  version = "v0.3.0";

  cargoBuildFlags = "-p typst-cli";
  cargoLock = {
    lockFile = "${src}/Cargo.lock";
    outputHashes = {
      "iai-0.1.1" = "sha256-EdNzCPht5chg7uF9O8CtPWR/bzSYyfYIXNdLltqdlR0=";
    };
  };
  src = fetchFromGitHub {
    owner = "typst";
    repo = "typst";
    sha256 = "sha256-JCsHNPQ9WHqq1Qg2j3TjRr0RCnwS8X3/K/n8FXYE8D4=";
    rev = version;
    leaveDotGit = true;
  };

  # the build.rs script wants a version hash from git.
  nativeBuildInputs = [
    git
    rust-bin.stable.latest.minimal
  ];
}