mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-29 16:24:10 +00:00
_1password: add shell completions
This commit is contained in:
parent
93eb4dbde1
commit
47417621a5
@ -1,4 +1,4 @@
|
|||||||
{ lib, stdenv, fetchzip, autoPatchelfHook, fetchurl, xar, cpio }:
|
{ lib, stdenv, fetchurl, fetchzip, autoPatchelfHook, installShellFiles, cpio, xar }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (stdenv.hostPlatform) system;
|
inherit (stdenv.hostPlatform) system;
|
||||||
@ -32,6 +32,8 @@ stdenv.mkDerivation {
|
|||||||
else
|
else
|
||||||
throw "Source for ${pname} is not available for ${system}";
|
throw "Source for ${pname} is not available for ${system}";
|
||||||
|
|
||||||
|
nativeBuildInputs = [ installShellFiles ] ++ lib.optional stdenv.isLinux autoPatchelfHook;
|
||||||
|
|
||||||
buildInputs = lib.optionals stdenv.isDarwin [ xar cpio ];
|
buildInputs = lib.optionals stdenv.isDarwin [ xar cpio ];
|
||||||
|
|
||||||
unpackPhase = lib.optionalString stdenv.isDarwin ''
|
unpackPhase = lib.optionalString stdenv.isDarwin ''
|
||||||
@ -41,11 +43,13 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
install -D ${mainProgram} $out/bin/${mainProgram}
|
install -D ${mainProgram} $out/bin/${mainProgram}
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
dontStrip = stdenv.isDarwin;
|
postInstall = "installShellCompletion --cmd ${mainProgram}" + lib.concatMapStrings
|
||||||
|
(s: " --${s} <($out/bin/${mainProgram} completion ${s})") [ "bash" "fish" "zsh" ];
|
||||||
|
|
||||||
nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
|
dontStrip = stdenv.isDarwin;
|
||||||
|
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user