nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenvNoCC,
4 fetchurl,
5 versionCheckHook,
6 installShellFiles,
7
8 writeShellApplication,
9 curl,
10 gnugrep,
11 common-updater-scripts,
12
13 pname ? "acli-unwrapped",
14 src,
15 version,
16 meta,
17 updateScript,
18}:
19stdenvNoCC.mkDerivation (finalAttrs: {
20 inherit
21 pname
22 src
23 version
24 meta
25 ;
26
27 dontBuild = true;
28
29 nativeBuildInputs = [ installShellFiles ];
30
31 installPhase = ''
32 runHook preInstall
33
34 install -Dm755 acli $out/bin/acli
35 ''
36 + lib.optionalString (stdenvNoCC.buildPlatform.canExecute stdenvNoCC.hostPlatform) ''
37 installShellCompletion --cmd acli \
38 --bash <($out/bin/acli completion bash) \
39 --fish <($out/bin/acli completion fish) \
40 --zsh <($out/bin/acli completion zsh)
41
42 mkdir -p $out/share/powershell
43 $out/bin/acli completion powershell > $out/share/powershell/acli.Completion.ps1
44 ''
45 + ''
46 runHook postInstall
47 '';
48
49 passthru = {
50 inherit updateScript;
51 };
52
53 nativeInstallCheckInputs = [ versionCheckHook ];
54 versionCheckProgramArg = "-v";
55 doInstallCheck = true;
56
57})