-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
47 lines (45 loc) · 1.5 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
43
44
45
46
47
{
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 ];
cargoHash = "sha256-nJJBMiFdLxNvLGKsThUlbFVT59JxVXMRfnaPAtOgROo=";
# 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";
};
};
};
});
}