|
4 | 4 | # Install AWS CLI and related tools |
5 | 5 | home.packages = with pkgs; [ awscli2 aws-sso-cli ssm-session-manager-plugin ]; |
6 | 6 |
|
7 | | - # Ensure custom AWS directory exists with proper permissions |
8 | | - home.activation.setupAwsDir = lib.hm.dag.entryAfter [ "writeBoundary" ] '' |
9 | | - mkdir -p $HOME/.aws-custom |
10 | | - chmod 700 $HOME/.aws-custom |
11 | | - ''; |
12 | | - |
13 | | - # Add a wrapper script that sets AWS_CONFIG_FILE before running aws commands |
14 | | - home.file.".bin/aws-wrapper" = { |
15 | | - executable = true; |
16 | | - text = '' |
17 | | - #!/usr/bin/env bash |
18 | | - # Wrapper for AWS CLI that uses custom config location |
19 | | - export AWS_CONFIG_FILE="$HOME/.aws-custom/config" |
20 | | - aws "$@" |
21 | | - ''; |
22 | | - }; |
23 | | - |
24 | | - # Add placeholder AWS config file in our custom location |
25 | | - home.file.".aws-custom/config".text = '' |
26 | | - # This is a placeholder AWS config file. |
27 | | - # To load your actual configuration from your private GitHub Gist, run: |
28 | | - # $ update-aws-config (or simply use the alias: uaws) |
29 | | - # |
30 | | - # This will fetch your AWS configuration securely using your GitHub CLI. |
| 7 | + # Explicitly tell home-manager not to manage the AWS config file |
| 8 | + xdg.configFile."aws/config".enable = false; |
31 | 9 |
|
32 | | - # Default fallback configuration |
33 | | - [default] |
34 | | - region = eu-west-2 |
35 | | - output = json |
| 10 | + home.activation.setupAws = lib.hm.dag.entryAfter [ "writeBoundary" ] '' |
| 11 | + # Create AWS directory with proper permissions |
| 12 | + mkdir -p $HOME/.aws |
| 13 | + chmod 700 $HOME/.aws |
36 | 14 | ''; |
37 | 15 |
|
38 | 16 | # Configure ZSH aliases for AWS-related scripts |
39 | 17 | programs.zsh.shellAliases = { |
40 | 18 | "uaws" = "update-aws-config"; # Short alias for update-aws-config |
41 | | - "aws" = "aws-wrapper"; # Use our wrapper for AWS commands |
42 | | - "awssso" = "aws-wrapper sso login"; # Quick login to AWS SSO |
43 | | - "awswho" = |
44 | | - "aws-wrapper sts get-caller-identity"; # Check current AWS identity |
| 19 | + "awssso" = "aws sso login"; # Quick login to AWS SSO |
| 20 | + "awswho" = "aws sts get-caller-identity"; # Check current AWS identity |
45 | 21 | }; |
46 | 22 | } |
0 commit comments