1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-15 23:59:45 +01:00

awscli: only write config files when not empty

This commit is contained in:
Moritz Rumpf 2023-12-13 00:21:10 +01:00 committed by GitHub
parent 0e7cd64674
commit d9297efd3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,11 +57,16 @@ in {
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
home.file."${config.home.homeDirectory}/.aws/config".source =
home.file."${config.home.homeDirectory}/.aws/config" =
lib.mkIf (cfg.settings != { }) {
source =
iniFormat.generate "aws-config-${config.home.username}" cfg.settings;
};
home.file."${config.home.homeDirectory}/.aws/credentials".source =
iniFormat.generate "aws-credentials-${config.home.username}"
home.file."${config.home.homeDirectory}/.aws/credentials" =
lib.mkIf (cfg.credentials != { }) {
source = iniFormat.generate "aws-credentials-${config.home.username}"
cfg.credentials;
};
};
}