about summary refs log tree commit diff
path: root/users/flokli/archeology/default.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-11-12T16·58+0200
committerflokli <flokli@flokli.de>2023-11-12T22·43+0000
commitc93086848fc00ea97690b6f8e5850fbe24cd11fa (patch)
tree8bf55fccb63688f1f2b6ce5f571ccc610e494214 /users/flokli/archeology/default.nix
parent47e24e6e8e15b2b509407f97ea5b0e05646d1563 (diff)
feat(users/flokli/archeology): add AWS config to shell r/7003
This allows using awscli inside a shell.

Clickhouse AWS SSO integration still seems broken unfortunately, even
with https://github.com/ClickHouse/ClickHouse/pull/54347 included in
our bump - it seems it's coming up with another token file path than the
AWS SDK:

> SSOCredentialsProvider: Unable to open token file on path: /home/flokli/.aws/sso/cache/da39a3ee5e6b4b0d3255bfef95601890afd80709.json

This is the sha1sum of the sso_start_url, not the sha1sum of the
session-name (nixos / f2f059b8b7298f1ad52636d67cef8b719aa83bf5).

Change-Id: Ia1bdec03c4f269a7415c42c90c1f4fd3d928f770
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10012
Reviewed-by: edef <edef@edef.eu>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/flokli/archeology/default.nix')
-rw-r--r--users/flokli/archeology/default.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/users/flokli/archeology/default.nix b/users/flokli/archeology/default.nix
index 0c875ce3a898..d642399cbe68 100644
--- a/users/flokli/archeology/default.nix
+++ b/users/flokli/archeology/default.nix
@@ -33,6 +33,19 @@ depot.nix.readTree.drvTargets {
 
   shell = pkgs.mkShell {
     name = "archeology-shell";
-    packages = with pkgs; [ clickhouse rust-analyzer rustc rustfmt ];
+    packages = with pkgs; [ awscli2 clickhoseLocalFixedAWS rust-analyzer rustc rustfmt ];
+
+    AWS_PROFILE = "sso";
+    AWS_CONFIG_FILE = pkgs.writeText "aws-config" ''
+      [sso-session nixos]
+      sso_region = eu-north-1
+      sso_start_url = https://nixos.awsapps.com/start
+      sso_registration_scopes = sso:account:access
+
+      [profile "sso"]
+      sso_session = nixos
+      sso_account_id = 080433136561
+      sso_role_name = archeologist
+    '';
   };
 }