about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/ty/typst/package.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-12-15 19:32:38 +0100
committerAlyssa Ross <hi@alyssa.is>2023-12-15 19:32:38 +0100
commit6b8e2555ef013b579cda57025b17d662e0f1fe1f (patch)
tree5a83c673af26c9976acd5a5dfa20e09e06898047 /nixpkgs/pkgs/by-name/ty/typst/package.nix
parent66ca7a150b5c051f0728f13134e6265cc46f370c (diff)
parent02357adddd0889782362d999628de9d309d202dc (diff)
downloadnixlib-6b8e2555ef013b579cda57025b17d662e0f1fe1f.tar
nixlib-6b8e2555ef013b579cda57025b17d662e0f1fe1f.tar.gz
nixlib-6b8e2555ef013b579cda57025b17d662e0f1fe1f.tar.bz2
nixlib-6b8e2555ef013b579cda57025b17d662e0f1fe1f.tar.lz
nixlib-6b8e2555ef013b579cda57025b17d662e0f1fe1f.tar.xz
nixlib-6b8e2555ef013b579cda57025b17d662e0f1fe1f.tar.zst
nixlib-6b8e2555ef013b579cda57025b17d662e0f1fe1f.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/by-name/ty/typst/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/ty/typst/package.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/ty/typst/package.nix b/nixpkgs/pkgs/by-name/ty/typst/package.nix
new file mode 100644
index 000000000000..24d333f669cc
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/ty/typst/package.nix
@@ -0,0 +1,54 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, installShellFiles
+, stdenv
+, darwin
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "typst";
+  version = "0.10.0";
+
+  src = fetchFromGitHub {
+    owner = "typst";
+    repo = "typst";
+    rev = "v${version}";
+    hash = "sha256-qiskc0G/ZdLRZjTicoKIOztRFem59TM4ki23Rl55y9s=";
+  };
+
+  cargoLock = {
+    lockFile = ./Cargo.lock;
+    outputHashes = {
+      "iai-0.1.1" = "sha256-EdNzCPht5chg7uF9O8CtPWR/bzSYyfYIXNdLltqdlR0=";
+    };
+  };
+
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
+  buildInputs = lib.optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.CoreServices
+  ];
+
+  env = {
+    GEN_ARTIFACTS = "artifacts";
+  };
+
+  postInstall = ''
+    installManPage crates/typst-cli/artifacts/*.1
+    installShellCompletion \
+      crates/typst-cli/artifacts/typst.{bash,fish} \
+      --zsh crates/typst-cli/artifacts/_typst
+  '';
+
+  meta = {
+    changelog = "https://github.com/typst/typst/releases/tag/${src.rev}";
+    description = "A new markup-based typesetting system that is powerful and easy to learn";
+    homepage = "https://github.com/typst/typst";
+    license = lib.licenses.asl20;
+    mainProgram = "typst";
+    maintainers = with lib.maintainers; [ drupol figsoda kanashimia ];
+  };
+}