Skip to content

Commit

Permalink
feat(nix): install shell completions and man page
Browse files Browse the repository at this point in the history
  • Loading branch information
pamburus committed Dec 25, 2024
1 parent 4bdd245 commit 54dd4b2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = [".", "crate/encstr"]
[workspace.package]
repository = "https://github.com/pamburus/hl"
authors = ["Pavel Ivanov <[email protected]>"]
version = "0.30.1-alpha.2"
version = "0.30.1-alpha.3"
edition = "2021"
license = "MIT"

Expand Down
21 changes: 18 additions & 3 deletions nix/package.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{ lib
, rustPlatform
,
{
lib,
stdenv,
rustPlatform,
installShellFiles,
}:
let
cargoToml = builtins.fromTOML (builtins.readFile ../Cargo.toml);
Expand All @@ -21,6 +23,19 @@ rustPlatform.buildRustPackage {
};
};

nativeBuildInputs = [ installShellFiles ];

postInstall = ''
installShellCompletion --cmd hl \
--bash <($out/bin/hl --shell-completions bash) \
--fish <($out/bin/hl --shell-completions fish) \
--zsh <($out/bin/hl --shell-completions zsh)
$out/bin/hl --man-page >hl.1
installManPage hl.1
'';

doCheck = false;

meta = {
description = cargoToml.package.description;
homepage = cargoToml.workspace.package.repository;
Expand Down

0 comments on commit 54dd4b2

Please sign in to comment.