From 78637556c778a7e6d9619b9968b635fdb93ba75d Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 19 Dec 2025 10:46:50 -0600 Subject: [PATCH] Slight speed up on vpn Rather than querying bitwarden thrice, which is a slow query, we take advantage of nushell konwing how to parse JSON output so we can only query once for the credentials and a second time for the OTP value --- flake.lock | 6 +++--- home/baseline/nushell.nix | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index e9506c5..e3f2fb5 100644 --- a/flake.lock +++ b/flake.lock @@ -1043,11 +1043,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1765850658, - "narHash": "sha256-WMxrG7K5kQQS0dc8b8WDdwKyBYokRc0Ssa1gIcAigBs=", + "lastModified": 1766109760, + "narHash": "sha256-7A0h2MCAmv/mRgZQSgTS89sXRdDN956hFkaHQ01XGRc=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "3117a5178ba33eafea691756cca52ab250f2a5a9", + "rev": "909232203bc0bc4c1e3311f41be190322bb04a94", "type": "github" }, "original": { diff --git a/home/baseline/nushell.nix b/home/baseline/nushell.nix index a25f88c..5699fdb 100644 --- a/home/baseline/nushell.nix +++ b/home/baseline/nushell.nix @@ -42,10 +42,9 @@ in def --env vpn [] { unlock - let username = ^bw get username f7351f9c-b25b-4317-8352-affc00da4644 - let password = ^bw get password f7351f9c-b25b-4317-8352-affc00da4644 + let login = ^bw get item f7351f9c-b25b-4317-8352-affc00da4644 | from json let otp = ^bw get totp 10371487-7f40-4b08-9a45-b33e00de318b - osascript ${vpn} $username $"($password)($otp)" + osascript ${vpn} $login.login.username $"($login.login.password)($otp)" } ''; settings = {