From c0d9a2662766fd70a23e0dbdd44ea80e529dc697 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 29 Mar 2024 23:13:40 +0100 Subject: [PATCH] meson: build and install nix3 manpages this notably does *not* install the `nix3-manpages` manpage the old system generated, mostly because that page was empty and just a bug with a coat of documentation paint. Change-Id: I7a4248a72e7bb5e0cc925a6311a33b6b72589569 --- doc/manual/meson.build | 125 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/doc/manual/meson.build b/doc/manual/meson.build index d898aa0a9..e764ba70b 100644 --- a/doc/manual/meson.build +++ b/doc/manual/meson.build @@ -127,6 +127,131 @@ foreach command : nix_nested_manpages endforeach endforeach +nix3_cli_json = custom_target( + command : [ nix, '__dump-cli' ], + capture : true, + output : 'nix.json', +) +nix3_cli_files = custom_target( + command : nix_eval_for_docs + [ + '--write-to', '@OUTPUT@', + '--expr', + 'import @INPUT1@ true (builtins.readFile @INPUT0@)', + ], + input : [ + nix3_cli_json, + 'generate-manpage.nix', + 'utils.nix', + ], + output : 'new-cli', +) + +nix3_manpages = [ + 'nix3-build', + 'nix3-bundle', + 'nix3-copy', + 'nix3-daemon', + 'nix3-derivation-add', + 'nix3-derivation', + 'nix3-derivation-show', + 'nix3-develop', + 'nix3-doctor', + 'nix3-edit', + 'nix3-eval', + 'nix3-flake-archive', + 'nix3-flake-check', + 'nix3-flake-clone', + 'nix3-flake-info', + 'nix3-flake-init', + 'nix3-flake-lock', + 'nix3-flake', + 'nix3-flake-metadata', + 'nix3-flake-new', + 'nix3-flake-prefetch', + 'nix3-flake-show', + 'nix3-flake-update', + 'nix3-fmt', + 'nix3-hash-file', + 'nix3-hash', + 'nix3-hash-path', + 'nix3-hash-to-base16', + 'nix3-hash-to-base32', + 'nix3-hash-to-base64', + 'nix3-hash-to-sri', + 'nix3-help', + 'nix3-help-stores', + 'nix3-key-convert-secret-to-public', + 'nix3-key-generate-secret', + 'nix3-key', + 'nix3-log', + 'nix3-nar-cat', + 'nix3-nar-dump-path', + 'nix3-nar-ls', + 'nix3-nar', + 'nix3-path-info', + 'nix3-print-dev-env', + 'nix3-profile-diff-closures', + 'nix3-profile-history', + 'nix3-profile-install', + 'nix3-profile-list', + 'nix3-profile', + 'nix3-profile-remove', + 'nix3-profile-rollback', + 'nix3-profile-upgrade', + 'nix3-profile-wipe-history', + 'nix3-realisation-info', + 'nix3-realisation', + 'nix3-registry-add', + 'nix3-registry-list', + 'nix3-registry', + 'nix3-registry-pin', + 'nix3-registry-remove', + 'nix3-repl', + 'nix3-run', + 'nix3-search', + 'nix3-shell', + 'nix3-show-config', + 'nix3-store-add-file', + 'nix3-store-add-path', + 'nix3-store-cat', + 'nix3-store-copy-log', + 'nix3-store-copy-sigs', + 'nix3-store-delete', + 'nix3-store-diff-closures', + 'nix3-store-dump-path', + 'nix3-store-gc', + 'nix3-store-ls', + 'nix3-store-make-content-addressed', + 'nix3-store', + 'nix3-store-optimise', + 'nix3-store-path-from-hash-part', + 'nix3-store-ping', + 'nix3-store-prefetch-file', + 'nix3-store-repair', + 'nix3-store-sign', + 'nix3-store-verify', + 'nix3-upgrade-nix', + 'nix3-why-depends', + 'nix', +] + +foreach page : nix3_manpages + custom_target( + command : [ + './render-manpage.sh', + page, + '1', + '@INPUT0@/' + page + '.md', + '@OUTPUT@.tmp', + '@OUTPUT@', + ], + input : nix3_cli_files, + output : page + '.1', + install : true, + install_dir : mandir / 'man1', + ) +endforeach + nix_manpages = [ [ 'nix-env', 1 ], [ 'nix-store', 1 ],