mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-26 18:24:53 +00:00
lux-cli: use Lux to generate man pages & completions
Signed-off-by: Marc Jakobi <marc@jakobi.dev>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
{
|
||||
stdenv,
|
||||
buildPackages,
|
||||
fetchFromGitHub,
|
||||
gnupg,
|
||||
gpgme,
|
||||
@@ -65,14 +67,25 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
nix
|
||||
];
|
||||
|
||||
postBuild = ''
|
||||
cargo xtask dist-man
|
||||
cargo xtask dist-completions
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
installManPage target/dist/*.1
|
||||
installShellCompletion target/dist/lx.{bash,fish} --zsh target/dist/_lx
|
||||
${
|
||||
# Using lx to generate man pages and completions is faster than xtask
|
||||
if stdenv.hostPlatform.emulatorAvailable buildPackages then
|
||||
let
|
||||
lx = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/lx";
|
||||
in
|
||||
''
|
||||
${lx} util man --target-dir="target/dist"
|
||||
${lx} util completion --target-dir="target/dist"
|
||||
''
|
||||
else
|
||||
''
|
||||
cargo xtask dist-man
|
||||
cargo xtask dist-completions
|
||||
''
|
||||
}
|
||||
installManPage target/dist/*.1
|
||||
installShellCompletion target/dist/lx.{bash,fish} --zsh target/dist/_lx
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
||||
Reference in New Issue
Block a user