44 lines
898 B
Nix
44 lines
898 B
Nix
{
|
|
description = "pdf report generation with typst";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = with pkgs; [
|
|
typst
|
|
tinymist
|
|
];
|
|
};
|
|
|
|
packages.default = pkgs.writeShellScriptBin "compile-report" ''
|
|
set -e
|
|
mkdir -p output
|
|
|
|
echo "compiling report"
|
|
typst compile main.typ
|
|
echo done
|
|
'';
|
|
|
|
apps.default = {
|
|
type = "app";
|
|
program = "${self.packages.${system}.default}/bin/compile-report";
|
|
};
|
|
}
|
|
);
|
|
}
|