From e636659caf41e57909331c10dec4f5cdfb83ddce Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Fri, 21 Jun 2024 13:28:25 +0530 Subject: [PATCH] feat: Use 1password cli insteado of bitwarden cli --- flake.lock | 2 +- neovim/nvim.nix | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index f5d2ef68..6ad3cd56 100644 --- a/flake.lock +++ b/flake.lock @@ -1657,7 +1657,7 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-yRBVZzNXmwyU9rHp8pHa2Y2VnyXSGzDHXiriCcF8Uks=", + "narHash": "sha256-DX3q8nvddvoz+RCvQ1EgbqCSguq1BaJi7Af0Zbl5xo0=", "path": "./neovim", "type": "path" }, diff --git a/neovim/nvim.nix b/neovim/nvim.nix index 4da05233..eec6ba8a 100644 --- a/neovim/nvim.nix +++ b/neovim/nvim.nix @@ -396,6 +396,11 @@ in rec { else if pkgs.stdenv.isDarwin then "${codelldb}/lldb/lib/liblldb.dylib" else null; + apikey = + pkgs.writeShellScriptBin + "openapikey" '' + ${pkgs._1password}/bin/op item get 'OpenAI API Token' --fields label=credential + ''; in /* lua @@ -488,11 +493,8 @@ in rec { }) require('chatgpt').setup({ - api_key_cmd = "${pkgs._1password}/bin/op item get 'OpenAI API Token' --fields label=credential", + api_key_cmd = "${apikey}/bin/openapikey", }) - -- require("gp").setup({ - -- openai_api_key = { "${pkgs.rbw}/bin/rbw", "get", "platform.openai.com" }, - -- }) require('octo').setup({ use_local_fs = false,