2022-03-19 21:12:18 +00:00
|
|
|
{ system, lib, pkgs }:
|
|
|
|
|
|
|
|
pkgs.stdenv.mkDerivation rec {
|
|
|
|
pname = "agilebits-op";
|
2022-07-28 20:33:01 +00:00
|
|
|
version = "2.6.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-07-28 20:33:01 +00:00
|
|
|
sha256 = "sha256-YPidRXNzNNuDoM2Gd5dEsCDxwosBJFKSzjoP0SPkQZs=";
|
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" ];
|
|
|
|
};
|
|
|
|
}
|