From 4f8d3953b36e8a67deba44ef524e4e032453c575 Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Thu, 14 Mar 2024 20:19:02 -0700 Subject: [PATCH] add nix output for the book --- flake.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/flake.nix b/flake.nix index cdfe91f8..0e699e1d 100644 --- a/flake.nix +++ b/flake.nix @@ -207,6 +207,35 @@ packages = { default = package pkgsHost; oci-image = mkOciImage pkgsHost self.packages.${system}.default; + + book = + let + package = self.packages.${system}.default; + in + pkgsHost.stdenv.mkDerivation { + pname = "${package.pname}-book"; + version = package.version; + + src = nix-filter { + root = ./.; + include = [ + "book.toml" + "conduit-example.toml" + "README.md" + "debian/README.md" + "docs" + ]; + }; + + nativeBuildInputs = (with pkgsHost; [ + mdbook + ]); + + buildPhase = '' + mdbook build + mv public $out + ''; + }; } // builtins.listToAttrs