1f11b0aeb0
* feat!: move docs to website * feat: flesh out docs site * docs: add changelog to website * docs: fix `npins add` command snippet * docs: remove broken declarations * ci: remove local docgen * docs: update site FAQ
48 lines
800 B
Nix
48 lines
800 B
Nix
{ lib
|
|
, stdenvNoCC
|
|
, writeShellApplication
|
|
, mdbook
|
|
, python3
|
|
}: { nixosDoc
|
|
, homeManagerDoc
|
|
, ...
|
|
}@args:
|
|
stdenvNoCC.mkDerivation (finalAttrs: args // {
|
|
nativeBuildInputs = [
|
|
mdbook
|
|
];
|
|
|
|
dontPatch = true;
|
|
dontConfigure = true;
|
|
doCheck = false;
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
|
|
ln -s ${nixosDoc} src/options/nixos-options.md
|
|
ln -s ${homeManagerDoc} src/options/home-manager-options.md
|
|
mdbook build
|
|
|
|
runHook postBuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mv book $out
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru = {
|
|
serve = writeShellApplication {
|
|
name = "serve";
|
|
|
|
runtimeInputs = [ python3 ];
|
|
|
|
text = ''
|
|
python -m http.server --bind 127.0.0.1 --directory ${finalAttrs.finalPackage}
|
|
'';
|
|
};
|
|
};
|
|
})
|