From d6102515ba1fad209633784f710b8ae360c3585e Mon Sep 17 00:00:00 2001 From: Mat Jones Date: Fri, 15 Dec 2023 10:43:21 -0500 Subject: [PATCH] fix(fish): Fallback to manual input if system password can't be pulled from 1Password --- home-manager/modules/fish.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/home-manager/modules/fish.nix b/home-manager/modules/fish.nix index 8b57fa95..acbed7f9 100644 --- a/home-manager/modules/fish.nix +++ b/home-manager/modules/fish.nix @@ -6,7 +6,13 @@ let #!${pkgs.bash}/bin/bash # TODO figure out a way to do this without silently depending on `op` being on $PATH # using `$\{pkgs._1password}/bin/op` results in unable to connect to desktop app - op item get "System Password" --fields password + PASSWORD="$(op item get "System Password" --fields password)" + if [[ -z "$PASSWORD" ]]; then + echo "Failed to get password from 1Password." + read -s -p "Password: " PASSWORD + fi + + echo $PASSWORD ''; op-shell-plugins = [ "gh" ]; in {