-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflake.nix
42 lines (40 loc) · 1.42 KB
/
flake.nix
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
description = "Tool to check a Typst package.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }:
let cargoMeta = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
packages = rec {
default = typst-package-check;
typst-package-check = pkgs.rustPlatform.buildRustPackage {
pname = cargoMeta.package.name;
version = cargoMeta.package.version;
src = ./.;
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.openssl.dev pkgs.git ];
useFetchCargoVendor = true;
cargoHash = "sha256-0t6bQzAbok/xBi53tr7KCU78Ew/i99B+AyfR36r7AA4=";
# Don't run `cargo test`, as there are no tests to run.
doCheck = false;
};
docker-image = pkgs.dockerTools.buildImage {
name = "ghcr.io/typst/package-check";
tag = typst-package-check.version;
copyToRoot = with pkgs.dockerTools; [
caCertificates
pkgs.git
typst-package-check
];
config = {
Entrypoint = [ "/bin/typst-package-check" ];
WorkingDir = "/data";
};
};
};
});
}