diff --git a/.chezmoiexternal.toml b/.chezmoiexternal.toml index c7b817b6..c5a08ead 100644 --- a/.chezmoiexternal.toml +++ b/.chezmoiexternal.toml @@ -9,3 +9,6 @@ url = "https://raw.githubusercontent.com/nushell/nushell/0.86.0/crates/nu-utils/ [".local/share/nushell/default_config.nu"] type = "file" url = "https://raw.githubusercontent.com/nushell/nushell/0.86.0/crates/nu-utils/src/sample_config/default_config.nu" +[".local/share/gitalias/gitalias.txt"] +type = "file" +url = "https://raw.githubusercontent.com/GitAlias/gitalias/main/gitalias.txt" diff --git a/dot_config/git/config b/dot_config/git/config index d34d2bf7..b0c659d4 100644 --- a/dot_config/git/config +++ b/dot_config/git/config @@ -48,3 +48,6 @@ [includeIf "gitdir:/workspaces/"] path = codespace + +[include] + path = ~/.local/share/gitalias/gitalias.txt diff --git a/dot_config/nushell/scripts/aliases.nu b/dot_config/nushell/scripts/aliases.nu index ced02c87..8e532f76 100644 --- a/dot_config/nushell/scripts/aliases.nu +++ b/dot_config/nushell/scripts/aliases.nu @@ -15,7 +15,7 @@ export alias g = git export alias a = git add -p export alias b = git branch export alias c = git commit -m -export alias s = git status +export alias s = git status --show-stash export alias m = git merge export alias p = git push export alias u = git pull @@ -43,8 +43,17 @@ export alias stash = git stash export alias wip = git commit -am "WIP" export alias fixup = git commit --fixup export alias unpushed = git log --branches --not --remotes --no-walk --decorate --oneline +export alias stashes = git stash list +export alias untracked = git status --untracked + export def unclean [] { gfold -d json ~/Code | from json | where status != Clean } +export def undone [] { + untracked + unpushed + stashes +} + export alias vi = hx export alias vim = vi export alias nvim = vi diff --git a/dot_config/nushell/scripts/aws-cluster-config.nu b/dot_config/nushell/scripts/aws-cluster-config.nu new file mode 100644 index 00000000..c2725960 --- /dev/null +++ b/dot_config/nushell/scripts/aws-cluster-config.nu @@ -0,0 +1,31 @@ +export def main [] { + with-env [ + AWS_PROFILE "infrastructure-testing-service-account" + AWS_REGION "us-east-1" + TEA_DIR $env.HOME + ] { + + tea -E aws configure + + ( + tea -E + aws eks update-cluster-config + --name infrastructure + --resources-vpc-config $'{"publicAccessCidrs": ["(http get https://ifconfig.me/ip)/32"]}' + ) + + ( + tea -E + aws eks update-kubeconfig + --name infrastructure + ) + + open ~/.kube/config + | from yaml + | update users.user.exec.command "tea" + | update users.user.exec.args {|config| $config.users.user.exec.args | flatten | prepend "aws"} + | to yaml + | save -f ~/.kube/config + } +} +