init slide

This commit is contained in:
2025-08-15 13:19:32 +08:00
parent 22724a13f0
commit fa2011f17a
4 changed files with 124 additions and 0 deletions

26
flake.nix Normal file
View File

@@ -0,0 +1,26 @@
{
inputs =
{
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
self.lfs = true;
};
outputs = inputs:
let
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; config.allowUnfree = true; };
typst = pkgs.typst.withPackages (ps: with ps; [ minimal-presentation ]);
env.TYPST_FONT_PATHS = builtins.concatStringsSep ":" (builtins.map (p: "${p}/share/fonts")
(with pkgs; [ corefonts source-han-serif nerd-fonts.fira-code ]));
buildTypst = name: source: pkgs.runCommand name { nativeBuildInputs = [ typst ]; src = ./.; inherit env; }
''
mkdir -p $out
typst compile --root $src $src/${source} $out/${name}
'';
in
{
packages.x86_64-linux =
{
paper = buildTypst "paper.pdf" "paper/main.typ";
slide = buildTypst "slide.pdf" "slide/main.typ";
};
};
}