diff options
Diffstat (limited to 'modules/home.legacy/conf/mail')
-rw-r--r-- | modules/home.legacy/conf/mail/accounts/benedikt.nix | 9 | ||||
-rw-r--r-- | modules/home.legacy/conf/mail/accounts/soispha.nix | 9 | ||||
-rw-r--r-- | modules/home.legacy/conf/mail/default.nix | 25 |
3 files changed, 38 insertions, 5 deletions
diff --git a/modules/home.legacy/conf/mail/accounts/benedikt.nix b/modules/home.legacy/conf/mail/accounts/benedikt.nix index 2fe72fca..e75cb523 100644 --- a/modules/home.legacy/conf/mail/accounts/benedikt.nix +++ b/modules/home.legacy/conf/mail/accounts/benedikt.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs}: { address = "benedikt.peetz@b-peetz.de"; userName = "benedikt.peetz@b-peetz.de"; diff --git a/modules/home.legacy/conf/mail/accounts/soispha.nix b/modules/home.legacy/conf/mail/accounts/soispha.nix index 6e3e6228..6bcb0da6 100644 --- a/modules/home.legacy/conf/mail/accounts/soispha.nix +++ b/modules/home.legacy/conf/mail/accounts/soispha.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. {pkgs}: { address = "soispha@vhack.eu"; userName = "soispha@vhack.eu"; diff --git a/modules/home.legacy/conf/mail/default.nix b/modules/home.legacy/conf/mail/default.nix index 5e35c002..17957c82 100644 --- a/modules/home.legacy/conf/mail/default.nix +++ b/modules/home.legacy/conf/mail/default.nix @@ -1,3 +1,12 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { config, pkgs, @@ -20,8 +29,14 @@ [ "$1" = "get" ] || { exit 1 } - if cat | grep "username=${userName}" -q; then - ${passwordCommand} + output="$(cat)" + if echo "$output" | grep "username=${userName}" -q; then + 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 @@ -29,11 +44,11 @@ ''); 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"; + name = "credential.smtp://${value.smtp.host}:${builtins.toString value.smtp.port}"; value = { - "smtp://${value.smtp.host}:${builtins.toString value.smtp.port}" = mkHelper value; + "helper" = mkHelper value; }; }) accounts; |