Merge pull request #464 from a4blue/flakeify-doc-generation

Added nix tooling for documentation
This commit is contained in:
koverstreet 2025-10-28 12:12:32 -04:00 committed by GitHub
commit 12d718a718
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -76,6 +76,16 @@
inherit system;
overlays = [ (import rust-overlay) ];
};
latexDerivation = (
pkgs.texliveBasic.withPackages (
ps: with ps; [
imakeidx
xkeyval
upquote
collection-fontsrecommended
]
)
);
in
{
packages =
@ -102,6 +112,22 @@
packages
// {
default = self'.packages.${cargoToml.package.name};
doc = pkgs.stdenv.mkDerivation {
pname = "bcachefs-tools-doc";
inherit version;
src = ./doc;
buildInputs = with pkgs; [
latexDerivation
];
buildPhase = ''
pdflatex bcachefs-principles-of-operation.tex
pdflatex bcachefs-principles-of-operation.tex
'';
installPhase = ''
mkdir -p $out/doc
cp bcachefs-principles-of-operation.pdf $out/doc
'';
};
};
checks = {
@ -157,6 +183,12 @@
];
};
devShells.doc = pkgs.mkShell {
packages = with pkgs; [
latexDerivation
];
};
treefmt.config = {
projectRootFile = "flake.nix";
flakeCheck = false;