From 38a7d58ef6a7528598de220a5263b65114d7cc9f Mon Sep 17 00:00:00 2001 From: kalipso Date: Thu, 24 Oct 2024 23:26:17 +0200 Subject: [PATCH] [doc] add doc package this can be used for hosting later on --- outputs.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/outputs.nix b/outputs.nix index 16af3e88..e28f168e 100644 --- a/outputs.nix +++ b/outputs.nix @@ -18,6 +18,25 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems devShells.default = pkgs.callPackage ./shell.nix { inherit (sops-nix.packages."${pkgs.system}") sops-import-keys-hook ssh-to-pgp sops-init-gpg-key; }; + + packages = { + docs = pkgs.stdenv.mkDerivation { + name = "malobeo-docs"; + phases = [ "buildPhase" ]; + buildInputs = [ pkgs.mdbook ]; + + inputs = pkgs.lib.sourceFilesBySuffices ./doc/. [ ".md" ".toml" ]; + + buildPhase = '' + dest=$out/share/doc + mkdir -p $dest + cp -r --no-preserve=all $inputs/* ./ + mdbook build + ls + cp -r ./book/* $dest + ''; + }; + }; })) // rec { nixosConfigurations = import ./machines/configuration.nix (inputs // { inherit inputs;