31 lines
851 B
Nix
31 lines
851 B
Nix
{ nixosConfig, lib, pkgs, config, ... }:
|
|
|
|
let
|
|
xdg = config.xdg;
|
|
in
|
|
{
|
|
config = lib.mkIf nixosConfig.jalr.aws.enable {
|
|
# https://github.com/aws/aws-sdk/issues/30
|
|
home.sessionVariables = {
|
|
AWS_CONFIG_FILE = "${xdg.configHome}/aws/config";
|
|
AWS_CLI_HISTORY_FILE = "${xdg.dataHome}/aws/history";
|
|
AWS_CREDENTIALS_FILE = "${xdg.dataHome}/aws/credentials";
|
|
AWS_WEB_IDENTITY_TOKEN_FILE = "${xdg.dataHome}/aws/token";
|
|
AWS_SHARED_CREDENTIALS_FILE = "${xdg.dataHome}/aws/shared-credentials";
|
|
};
|
|
|
|
xdg.configFile."aws/config".text = lib.generators.toINI { } (
|
|
lib.mapAttrs'
|
|
(name: value:
|
|
lib.attrsets.nameValuePair ("profile ${name}") (value)
|
|
)
|
|
nixosConfig.jalr.aws.accounts
|
|
//
|
|
{
|
|
"default" = {
|
|
"output" = "json";
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|