mirror of
https://github.com/nix-community/nixos-anywhere.git
synced 2024-09-11 08:35:24 +03:00
19 lines
513 B
Nix
19 lines
513 B
Nix
{
|
|
perSystem = { pkgs, lib, ... }: {
|
|
packages.docs = pkgs.runCommand "nixos-anywhere-docs"
|
|
{
|
|
passthru.serve = pkgs.writeShellScriptBin "serve" ''
|
|
set -euo pipefail
|
|
cd docs
|
|
workdir=$(${pkgs.coreutils}/bin/mktemp -d)
|
|
trap 'rm -rf "$workdir"' EXIT
|
|
${lib.getExe pkgs.mdbook} serve --dest-dir "$workdir"
|
|
'';
|
|
}
|
|
''
|
|
cp -r ${lib.cleanSource ./.}/* .
|
|
${lib.getExe pkgs.mdbook} build --dest-dir "$out"
|
|
'';
|
|
};
|
|
}
|