From d91e0da1605e150190b3e452b53cdf10087dba77 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Wed, 1 May 2024 10:05:59 +0200 Subject: stop committing plans --- profiles/core/git.nix | 1 + profiles/core/home.nix | 30 ++++++++++++++++++++++++++++++ profiles/station/packages.nix | 5 ++--- 3 files changed, 33 insertions(+), 3 deletions(-) (limited to 'profiles') diff --git a/profiles/core/git.nix b/profiles/core/git.nix index dee2d84..b1d3ea6 100644 --- a/profiles/core/git.nix +++ b/profiles/core/git.nix @@ -20,6 +20,7 @@ "/.env" ".vimsession.vim" "tfplan" + "plan" ]; }; }; diff --git a/profiles/core/home.nix b/profiles/core/home.nix index 571428e..3788da7 100644 --- a/profiles/core/home.nix +++ b/profiles/core/home.nix @@ -151,6 +151,36 @@ } bindkey -s '^o' '^ulfcd\n' + login-to-cloud () { + case $1 in + aws) + export AWS_PROFILE=$(aws configure list-profiles | grep -v default | fzf) + if ! error=$(aws sts get-caller-identity 2>&1); then + if echo "$error" | grep 'SSO session associated with this profile has expired'; then + aws sso login + else + echo "Not sure what to do with error: $error" + fi + fi + ;; + gcp) + gcloud config configurations activate $(gcloud config configurations list --format json | jq '.[] | "\(.name) \(.properties.core.account)"' -r | fzf | awk '{print $1}') + if ! gcloud compute instances list &> /dev/null /dev/null; then + az login --tenant $(az account show | jq '.tenantId' -r) + fi + ;; + *) echo "Don't know how to switch context for: $1" ;; + esac + } + + export ZLE_REMOVE_SUFFIX_CHARS=$' \t\n;&|/@' export EDITOR="nvim" export TERMINAL="st" ( command -v brew ) &>/dev/null && eval "$(/opt/homebrew/bin/brew shellenv)" diff --git a/profiles/station/packages.nix b/profiles/station/packages.nix index 7a3c0fb..0124979 100644 --- a/profiles/station/packages.nix +++ b/profiles/station/packages.nix @@ -12,9 +12,6 @@ bashInteractive powershell - arduino-ide - arduino-cli - k9s krew azure-cli @@ -24,6 +21,8 @@ ])) imagemagick ] ++ (optionals (!machine.isDarwin) [ + arduino-ide + arduino-cli xdotool pywal dasel -- cgit v1.2.3