summaryrefslogtreecommitdiff
path: root/pkgs/typst.nix
blob: 79e56220292df7ad2a89054ec2ab12f668397dba (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
28
{ rustPlatform, fetchFromGitHub, lib, git, rust-bin, ... }:

rustPlatform.buildRustPackage rec {
  pname = "typst-cli";
  version = "v23-03-28";

  cargoBuildFlags = "-p typst-cli";
  cargoLock = {
    lockFile = "${src}/Cargo.lock";
    outputHashes = {
      "iai-0.1.1" = "sha256-EdNzCPht5chg7uF9O8CtPWR/bzSYyfYIXNdLltqdlR0=";
      "lipsum-0.8.2" = "sha256-deIbpn4YM7/NeuJ5Co48ivJmxwrcsbLl6c3cP3JZxAQ=";
    };
  };
  src = fetchFromGitHub {
    owner = "typst";
    repo = "typst";
    sha256 = "sha256-kI/aZvDNbdtrvmqNt/pyeFdwef69jfuKZvAn0qZllnc=";
    rev = version;
    leaveDotGit = true;
  };

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