nixos-configuration/users/jalr/modules/aws.nix
Jakob Lechner 1841031fbc Change home-manager structure
After I quit Tradebyte, I'm now only having a single user account. It
makes sense to restructure the home-manager configuration.
2024-05-29 02:05:52 +02:00

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";
};
}
);
};
}