1
0
Fork 0
nix-overlay/packages/agilebits-op.nix

37 lines
800 B
Nix

{ pkgs, lib }:
pkgs.stdenv.mkDerivation rec {
pname = "agilebits-op";
version = "2.15.0";
src = pkgs.fetchurl {
url = "https://cache.agilebits.com/dist/1P/op2/pkg/v${version}/op_apple_universal_v${version}.pkg";
sha256 = "sha256-KJVXW2Ze1AmDWNeTEfr7SsZMBmLyMfBv/FgC+XAds0A=";
};
buildInputs = with pkgs; [ xar cpio ];
unpackPhase = ''
xar -xf $src
zcat op.pkg/Payload | cpio -i
'';
dontStrip = true;
installPhase = ''
install -D op $out/bin/op
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/op --version
'';
meta = with lib; {
description = "1Password command-line tool";
homepage = "https://developer.1password.com/docs/cli";
license = licenses.unfree;
platforms = [ "x86_64-darwin" "aarch64-darwin" ];
};
}