From 624204dac9feed0958ac2413086b765c798ce358 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Sat, 19 Mar 2022 22:12:18 +0100 Subject: [PATCH] Add agilebits-op --- README.md | 1 + flake.lock | 6 +++--- overlay.nix | 2 +- packages.nix | 1 + packages/agilebits-op.nix | 37 +++++++++++++++++++++++++++++++++++++ packages/cliclick.nix | 8 ++++++++ 6 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 packages/agilebits-op.nix diff --git a/README.md b/README.md index 4883763..27e9c97 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,6 @@ ## Software +* [agilebits-op](https://app-updates.agilebits.com/product_history/CLI2) * [cliclick](https://github.com/BlueM/cliclick) * [proximity-sort](https://github.com/jonhoo/proximity-sort) diff --git a/flake.lock b/flake.lock index e9759eb..6648980 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1639807448, - "narHash": "sha256-VA9twSpyM0e5Y5XAm20y5Vg6avky+imzfr65FoFq0G0=", + "lastModified": 1647350163, + "narHash": "sha256-OcMI+PFEHTONthXuEQNddt16Ml7qGvanL3x8QOl2Aao=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2d555e5f6529d8485ea7ccdbd3633cf1681eaa2e", + "rev": "3eb07eeafb52bcbf02ce800f032f18d666a9498d", "type": "github" }, "original": { diff --git a/overlay.nix b/overlay.nix index 2aab4d7..d248c24 100644 --- a/overlay.nix +++ b/overlay.nix @@ -3,7 +3,7 @@ _: super: let custom = super.callPackage ./packages.nix { }; in { - inherit custom; + inherit (custom) agilebits-op; inherit (custom) cliclick; inherit (custom) proximity-sort; } diff --git a/packages.nix b/packages.nix index 6b55dda..56a53c4 100644 --- a/packages.nix +++ b/packages.nix @@ -1,6 +1,7 @@ { system, lib, pkgs }: { + agilebits-op = import ./packages/agilebits-op.nix { inherit system lib pkgs; }; cliclick = import ./packages/cliclick.nix { inherit system lib pkgs; }; proximity-sort = import ./packages/proximity-sort.nix { inherit system lib pkgs; }; } diff --git a/packages/agilebits-op.nix b/packages/agilebits-op.nix new file mode 100644 index 0000000..e7f188a --- /dev/null +++ b/packages/agilebits-op.nix @@ -0,0 +1,37 @@ +{ system, lib, pkgs }: + +pkgs.stdenv.mkDerivation rec { + pname = "agilebits-op"; + version = "2.0.0"; + + src = pkgs.fetchurl { + url = "https://cache.agilebits.com/dist/1P/op2/pkg/v${version}/op_apple_universal_v${version}.pkg"; + sha256 = "DC9hdzRjQ9iNjbe6PfRpMXzDeInq4rYSAa2nDHQMTRo="; + }; + + 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" ]; + }; +} diff --git a/packages/cliclick.nix b/packages/cliclick.nix index 7d3a0ef..5cda9a2 100644 --- a/packages/cliclick.nix +++ b/packages/cliclick.nix @@ -23,11 +23,19 @@ pkgs.stdenv.mkDerivation { IOKit ]); + dontStrip = true; + installPhase = '' mkdir -p $out/bin cp cliclick $out/bin ''; + doInstallCheck = true; + + installCheckPhase = '' + $out/bin/cliclick -V + ''; + meta = with lib; { description = "macOS CLI tool for emulating mouse and keyboard events"; homepage = "https://github.com/BlueM/cliclick";