Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkgs/applications/misc/comodoro/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
, fetchFromGitHub
, stdenv
, installShellFiles
, installShellCompletions ? stdenv.hostPlatform == stdenv.buildPlatform
, installManPages ? stdenv.hostPlatform == stdenv.buildPlatform
, installShellCompletions ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, installManPages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, withTcp ? true
}:

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/misc/flavours/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec {

nativeBuildInputs = [ installShellFiles ];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd flavours \
--zsh <($out/bin/flavours --completions zsh) \
--fish <($out/bin/flavours --completions fish) \
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/misc/genact/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, rustPlatform, fetchFromGitHub, installShellFiles }:
{ lib, rustPlatform, fetchFromGitHub, installShellFiles, stdenv }:

rustPlatform.buildRustPackage rec {
pname = "genact";
Expand All @@ -15,7 +15,7 @@ rustPlatform.buildRustPackage rec {

nativeBuildInputs = [ installShellFiles ];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
$out/bin/genact --print-manpage > genact.1
installManPage genact.1

Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/misc/inlyne/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ rustPlatform.buildRustPackage rec {
"--skip=watcher::tests::the_gauntlet"
];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd inlyne \
--bash <($out/bin/inlyne --gen-completions bash) \
--fish <($out/bin/inlyne --gen-completions fish) \
--zsh <($out/bin/inlyne --gen-completions zsh)
--bash completions/inlyne.bash \
--fish completions/inlyne.fish \
--zsh completions/_inlyne
'';

postFixup = lib.optionalString stdenv.isLinux ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/misc/leetcode-cli/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rustPlatform.buildRustPackage rec {
sqlite
] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd leetcode \
--bash <($out/bin/leetcode completions bash) \
--fish <($out/bin/leetcode completions fish) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ rustPlatform.buildRustPackage rec {

postInstall = ''
installManPage Documentation/git-absorb.1
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd git-absorb \
--bash <($out/bin/git-absorb --gen-completions bash) \
--fish <($out/bin/git-absorb --gen-completions fish) \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/version-management/jujutsu/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ rustPlatform.buildRustPackage rec {
libiconv
];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
$out/bin/jj util mangen > ./jj.1
installManPage ./jj.1

Expand Down
3 changes: 2 additions & 1 deletion pkgs/applications/virtualization/youki/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
, dbus
, libseccomp
, systemd
, stdenv
}:

rustPlatform.buildRustPackage rec {
Expand All @@ -27,7 +28,7 @@ rustPlatform.buildRustPackage rec {

buildInputs = [ dbus libseccomp systemd ];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd youki \
--bash <($out/bin/youki completion -s bash) \
--fish <($out/bin/youki completion -s fish) \
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/ab/ab-av1/package.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, rustPlatform, fetchFromGitHub, installShellFiles }:
{ lib, rustPlatform, fetchFromGitHub, installShellFiles, stdenv }:

rustPlatform.buildRustPackage rec {
pname = "ab-av1";
Expand All @@ -15,7 +15,7 @@ rustPlatform.buildRustPackage rec {

nativeBuildInputs = [ installShellFiles ];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd ab-av1 \
--bash <($out/bin/ab-av1 print-completions bash) \
--fish <($out/bin/ab-av1 print-completions fish) \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/as/ast-grep/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rustPlatform.buildRustPackage rec {
rm .cargo/config.toml
'';

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd sg \
--bash <($out/bin/sg completions bash) \
--fish <($out/bin/sg completions fish) \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/at/attic-client/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ rustPlatform.buildRustPackage {
# to nix-daemon to import NARs, which is not possible in the build sandbox.
doCheck = false;

postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
if [[ -f $out/bin/attic ]]; then
installShellCompletion --cmd attic \
--bash <($out/bin/attic gen-completions bash) \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/cl/clipcat/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ rustPlatform.buildRustPackage rec {
"--skip=test_x11_primary"
];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
for cmd in clipcatd clipcatctl clipcat-menu clipcat-notify; do
installShellCompletion --cmd $cmd \
--bash <($out/bin/$cmd completions bash) \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/co/codeberg-cli/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ rustPlatform.buildRustPackage rec {
]
);

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd berg \
--bash <($out/bin/berg completion bash) \
--fish <($out/bin/berg completion fish) \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/di/diesel-cli/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ rustPlatform.buildRustPackage rec {
# Tests currently fail due to *many* duplicate definition errors
doCheck = false;

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd diesel \
--bash <($out/bin/diesel completions bash) \
--fish <($out/bin/diesel completions fish) \
Expand Down
3 changes: 2 additions & 1 deletion pkgs/by-name/el/elf2nucleus/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, lib
, micronucleus
, rustPlatform
, stdenv
}:

rustPlatform.buildRustPackage rec {
Expand All @@ -23,7 +24,7 @@ rustPlatform.buildRustPackage rec {

buildInputs = [ micronucleus ];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd elf2nucleus \
--bash <($out/bin/elf2nucleus --completions bash) \
--fish <($out/bin/elf2nucleus --completions fish) \
Expand Down
7 changes: 5 additions & 2 deletions pkgs/by-name/en/engage/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, installShellFiles
, rustPlatform
, fetchFromGitLab
, stdenv
}:

let
Expand All @@ -25,7 +26,8 @@ rustPlatform.buildRustPackage {
installShellFiles
];

postInstall = "installShellCompletion --cmd ${pname} "
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) (
"installShellCompletion --cmd ${pname} "
+ builtins.concatStringsSep
" "
(builtins.map
Expand All @@ -35,7 +37,8 @@ rustPlatform.buildRustPackage {
"fish"
"zsh"
]
);
)
);

meta = {
description = "Task runner with DAG-based parallelism";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/hi/himalaya/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
, pkg-config
, darwin
, installShellFiles
, installShellCompletions ? stdenv.hostPlatform == stdenv.buildPlatform
, installManPages ? stdenv.hostPlatform == stdenv.buildPlatform
, installShellCompletions ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, installManPages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, notmuch
, gpgme
, buildNoDefaultFeatures ? false
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/jo/joshuto/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rustPlatform.buildRustPackage rec {
darwin.apple_sdk.frameworks.Foundation
];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd joshuto \
--bash <($out/bin/joshuto completions bash) \
--zsh <($out/bin/joshuto completions zsh) \
Expand Down
43 changes: 23 additions & 20 deletions pkgs/by-name/ma/maa-cli/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,32 @@ rustPlatform.buildRustPackage rec {

# maa-cli would only seach libMaaCore.so and resources in itself's path
# https://github.com/MaaAssistantArknights/maa-cli/issues/67
postInstall = ''
mkdir -p $out/share/maa-assistant-arknights/
ln -s ${maa-assistant-arknights}/share/maa-assistant-arknights/* $out/share/maa-assistant-arknights/
ln -s ${maa-assistant-arknights}/lib/* $out/share/maa-assistant-arknights/
mv $out/bin/maa $out/share/maa-assistant-arknights/
postInstall =
''
mkdir -p $out/share/maa-assistant-arknights/
ln -s ${maa-assistant-arknights}/share/maa-assistant-arknights/* $out/share/maa-assistant-arknights/
ln -s ${maa-assistant-arknights}/lib/* $out/share/maa-assistant-arknights/
mv $out/bin/maa $out/share/maa-assistant-arknights/

makeWrapper $out/share/maa-assistant-arknights/maa $out/bin/maa \
--prefix PATH : "${
lib.makeBinPath [
android-tools
git
]
}"
makeWrapper $out/share/maa-assistant-arknights/maa $out/bin/maa \
--prefix PATH : "${
lib.makeBinPath [
android-tools
git
]
}"

installShellCompletion --cmd maa \
--bash <($out/bin/maa complete bash) \
--fish <($out/bin/maa complete fish) \
--zsh <($out/bin/maa complete zsh)
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd maa \
--bash <($out/bin/maa complete bash) \
--fish <($out/bin/maa complete fish) \
--zsh <($out/bin/maa complete zsh)

mkdir -p manpage
$out/bin/maa mangen --path manpage
installManPage manpage/*
'';
mkdir -p manpage
$out/bin/maa mangen --path manpage
installManPage manpage/*
'';

meta = with lib; {
description = "Simple CLI for MAA by Rust";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/ne/neverest/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
, pkg-config
, darwin
, installShellFiles
, installShellCompletions ? stdenv.hostPlatform == stdenv.buildPlatform
, installManPages ? stdenv.hostPlatform == stdenv.buildPlatform
, installShellCompletions ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, installManPages ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
, notmuch
, buildNoDefaultFeatures ? false
, buildFeatures ? []
Expand Down
3 changes: 2 additions & 1 deletion pkgs/by-name/pa/pace/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
rustPlatform,
fetchFromGitHub,
installShellFiles,
stdenv,
}: let
version = "0.15.2";
in
Expand All @@ -21,7 +22,7 @@ in

nativeBuildInputs = [installShellFiles];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd pace \
--bash <($out/bin/pace setup completions bash) \
--fish <($out/bin/pace setup completions fish) \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/pi/pixi/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ rustPlatform.buildRustPackage rec {
"--skip=cli::shell_hook::tests::test_environment_json"
];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd pixi \
--bash <($out/bin/pixi completion --shell bash) \
--fish <($out/bin/pixi completion --shell fish) \
Expand Down
2 changes: 2 additions & 0 deletions pkgs/by-name/qr/qrtool/package.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, asciidoctor
Expand All @@ -24,6 +25,7 @@ rustPlatform.buildRustPackage rec {
# Built by ./build.rs using `asciidoctor`
installManPage ./target/*/release/build/qrtool*/out/*.?

'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd qrtool \
--bash <($out/bin/qrtool --generate-completion bash) \
--fish <($out/bin/qrtool --generate-completion fish) \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/re/release-plz/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ rustPlatform.buildRustPackage rec {
# Tests depend on additional infrastructure to be running locally
doCheck = false;

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd ${meta.mainProgram} \
--bash <($out/bin/${meta.mainProgram} generate-completions bash) \
--fish <($out/bin/${meta.mainProgram} generate-completions fish) \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/sn/sn0int/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ rustPlatform.buildRustPackage rec {
# in "checkPhase", hence fails in sandbox of "nix".
doCheck = false;

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd sn0int \
--bash <($out/bin/sn0int completions bash) \
--fish <($out/bin/sn0int completions fish) \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/so/solana-cli/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ rustPlatform.buildRustPackage rec {
Libsystem
];

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd solana \
--bash <($out/bin/solana completion --shell bash) \
--fish <($out/bin/solana completion --shell fish) \
Expand Down
3 changes: 2 additions & 1 deletion pkgs/by-name/st/steamguard-cli/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, lib
, rustPlatform
, fetchFromGitHub
, stdenv
}:

rustPlatform.buildRustPackage rec {
Expand All @@ -18,7 +19,7 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-LYrn0MKrOYjYPLdBukXRXGW+XWVcGHNAl0vC/qkmkNs=";

nativeBuildInputs = [ installShellFiles ];
postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd steamguard \
--bash <($out/bin/steamguard completion --shell bash) \
--fish <($out/bin/steamguard completion --shell fish) \
Expand Down
2 changes: 1 addition & 1 deletion pkgs/by-name/zo/zola/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ rustPlatform.buildRustPackage rec {

RUSTONIG_SYSTEM_LIBONIG = true;

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd zola \
--bash <($out/bin/zola completion bash) \
--fish <($out/bin/zola completion fish) \
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/jrsonnet/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, rustPlatform, fetchFromGitHub, installShellFiles }:
{ lib, rustPlatform, fetchFromGitHub, installShellFiles, stdenv }:

rustPlatform.buildRustPackage rec {
pname = "jrsonnet";
Expand Down Expand Up @@ -28,6 +28,7 @@ rustPlatform.buildRustPackage rec {
postInstall = ''
ln -s $out/bin/jrsonnet $out/bin/jsonnet

'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
for shell in bash zsh fish; do
installShellCompletion --cmd jrsonnet \
--$shell <($out/bin/jrsonnet --generate $shell /dev/null)
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/tools/cocogitto/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rustPlatform.buildRustPackage rec {

buildInputs = [ libgit2 ] ++ lib.optional stdenv.isDarwin Security;

postInstall = ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd cog \
--bash <($out/bin/cog generate-completions bash) \
--fish <($out/bin/cog generate-completions fish) \
Expand Down
Loading