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

38 lines
800 B
Nix
Raw Normal View History

2022-03-19 21:12:18 +00:00
{ system, lib, pkgs }:
pkgs.stdenv.mkDerivation rec {
pname = "agilebits-op";
2022-05-23 09:28:27 +00:00
version = "2.3.0";
2022-03-19 21:12:18 +00:00
src = pkgs.fetchurl {
url = "https://cache.agilebits.com/dist/1P/op2/pkg/v${version}/op_apple_universal_v${version}.pkg";
2022-05-23 09:28:27 +00:00
sha256 = "f4hEYklyx33FT0rskR5o7Brpk8b0XbiOPNaYssgjjjY=";
2022-03-19 21:12:18 +00:00
};
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" ];
};
}