From 7feed58ce587a44b62730a49b16812552a4c2865 Mon Sep 17 00:00:00 2001 From: Alexander Ratajczak Date: Tue, 28 Oct 2025 17:02:18 +0100 Subject: [PATCH] * added nix build output for doc * added nix develop shell for doc --- flake.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/flake.nix b/flake.nix index 84d3ac31..aea16741 100644 --- a/flake.nix +++ b/flake.nix @@ -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;