bacon: install shell completions
This commit is contained in:
@@ -3,10 +3,12 @@
|
||||
stdenv,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
pkg-config,
|
||||
alsa-lib,
|
||||
versionCheckHook,
|
||||
bacon,
|
||||
buildPackages,
|
||||
nix-update-script,
|
||||
|
||||
withSound ? false,
|
||||
@@ -41,9 +43,13 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
"sound"
|
||||
];
|
||||
|
||||
nativeBuildInputs = lib.optionals withSound [
|
||||
pkg-config
|
||||
];
|
||||
nativeBuildInputs =
|
||||
[
|
||||
installShellFiles
|
||||
]
|
||||
++ lib.optionals withSound [
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = lib.optionals withSound soundDependencies;
|
||||
|
||||
@@ -51,6 +57,17 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
versionCheckProgramArg = [ "--version" ];
|
||||
doInstallCheck = true;
|
||||
|
||||
postInstall =
|
||||
let
|
||||
bacon = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/bacon";
|
||||
in
|
||||
lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
|
||||
installShellCompletion --cmd bacon \
|
||||
--bash <(COMPLETE=bash ${bacon}) \
|
||||
--fish <(COMPLETE=fish ${bacon}) \
|
||||
--zsh <(COMPLETE=zsh ${bacon})
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests = {
|
||||
withSound = bacon.override { withSound = true; };
|
||||
|
||||
Reference in New Issue
Block a user