aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-03-10 16:34:49 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-03-10 16:34:49 +0100
commit66e4fbe206dbfa3d2f43579733e4d0837b690864 (patch)
tree0f64e7c7ac3ede0c32b62f6ad986c7e402427420
parentbuild(treewide): Update (diff)
downloadnixos-config-66e4fbe206dbfa3d2f43579733e4d0837b690864.zip
fix(modules/legacy/conf/mail/git-credential-helper): Exit cleanly if passwordCommand fails
Diffstat (limited to '')
-rw-r--r--modules/home.legacy/conf/mail/default.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/home.legacy/conf/mail/default.nix b/modules/home.legacy/conf/mail/default.nix
index 758d2c80..46526173 100644
--- a/modules/home.legacy/conf/mail/default.nix
+++ b/modules/home.legacy/conf/mail/default.nix
@@ -22,7 +22,12 @@
}
output="$(cat)"
if echo "$output" | grep "username=${userName}" -q; then
- printf "%s\npassword=%s\n\n" "$output" "$(${passwordCommand})"
+ if password="$(${passwordCommand})"; then
+ printf "%s\npassword=%s\n\n" "$output" "$password"
+ else
+ # The password command failed (for whatever reason)
+ exit 1
+ fi
else
# Not our business.
exit 1
@@ -30,7 +35,7 @@
'');
accountCredentials =
# TODO: This will result in only one of them being defined, as we duplicate the
- # attribute key<2025-02-03>
+ # attribute key <2025-02-03>
lib.mapAttrs' (_: value: {
name = "credential.smtp://${value.smtp.host}:${builtins.toString value.smtp.port}";
value = {