home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ca2b2054bb10df5428ecd97ee8aa84cf6146d503
parent 8743663280fddc86d33257a0c48aad572f6866d6
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Tue, 14 Aug 2018 15:44:12 +0200

Add op v0.5.1

op is 1password cli tool 👼

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mpkgs/default.nix | 4++++
Apkgs/op/default.nix | 36++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -6,10 +6,14 @@ in rec { dobi = import ./dobi { inherit (pkgs) stdenv lib fetchFromGitHub buildGoPackage; }; + op = import ./op { + inherit (pkgs) stdenv lib fetchurl patchelf unzip file; + }; prm = import ./prm { inherit (pkgs) stdenv lib fetchgit; }; tmux-tpm = import ./tmux-tpm { inherit (pkgs) stdenv lib fetchFromGitHub; }; + } diff --git a/pkgs/op/default.nix b/pkgs/op/default.nix @@ -0,0 +1,36 @@ +{ stdenv, lib, fetchurl, patchelf, unzip, file }: + +stdenv.mkDerivation rec { + name = "op-${version}"; + version = "0.5.1"; + + src = if stdenv.system == "i686-linux" then + fetchurl { + url = "https://cache.agilebits.com/dist/1P/op/pkg/v${version}/op_linux_386_v${version}.zip"; + sha256 = "011s77krmp2fj3889fyiwhx3f9854yykd1i34y9pa8gy2hgxkh85"; + } + else if stdenv.system == "x86_64-linux" then + fetchurl { + url = "https://cache.agilebits.com/dist/1P/op/pkg/v${version}/op_linux_amd64_v${version}.zip"; + sha256 = "18yp1ridj9v9x54jyz8yyjvnhcv6gz5bjqjv4sl8dqiy6bli4wzv"; + } + else throw "platform ${stdenv.system} not supported!"; + + buildInputs = [ patchelf unzip file ]; + buildCommand = '' + unpackFile $src + mkdir -p $out/bin + cp -a ./op $out/bin/op.wrapped + chmod +x $out/bin/op.wrapped + echo "#!/usr/bin/env bash" > $out/bin/op + echo $(< $NIX_CC/nix-support/dynamic-linker) $out/bin/op.wrapped \"\$@\" >> $out/bin/op + chmod +x $out/bin/op + ''; + + meta = { + description = "1password CLI"; + homepage = "https://1password.com/"; + license = lib.licenses.unfree; + platforms = lib.platforms.linux; + }; +}