diff --git a/home-manager/programs/zsh.nix b/home-manager/programs/zsh.nix index ea831ac..6775971 100644 --- a/home-manager/programs/zsh.nix +++ b/home-manager/programs/zsh.nix @@ -47,13 +47,13 @@ in # Strip account ID and hash up to the region part URL="''${URL#*\.}" - PROFILE=$(${pkgs.coreutils}/bin/grep "sso_account_id = $ACCOUNT_ID" ~/.aws/config -B 5 | ${pkgs.coreutils}/bin/grep "\[profile" | ${pkgs.coreutils}/bin/tail -n 1 | ${pkgs.coreutils}/bin/tr -d '[]') + PROFILE=$(${pkgs.gnugrep}/bin/grep "sso_account_id = $ACCOUNT_ID" ~/.aws/config -B 5 | ${pkgs.gnugrep}/bin/grep "\[profile" | ${pkgs.coreutils}/bin/tail -n 1 | ${pkgs.coreutils}/bin/tr -d '[]') PROFILE="''${PROFILE#profile }" ROLE_NAME=$(${pkgs.awscli2}/bin/aws configure get profile.$PROFILE.sso_role_name) SSO_SESSION=$(${pkgs.awscli2}/bin/aws configure get profile.$PROFILE.sso_session) - SSO_URL=$(${pkgs.coreutils}/bin/grep "\[sso-session $SSO_SESSION" ~/.aws/config -A5 | ${pkgs.coreutils}/bin/grep sso_start_url | ${pkgs.coreutils}/bin/head -n 1) + SSO_URL=$(${pkgs.gnugrep}/bin/grep "\[sso-session $SSO_SESSION" ~/.aws/config -A5 | ${pkgs.gnugrep}/bin/grep sso_start_url | ${pkgs.coreutils}/bin/head -n 1) SSO_URL="''${SSO_URL#sso_start_url = }" # Strip trailing slash from SSO_URL if present SSO_URL="''${SSO_URL%/}"