From 63851306aca508b6dd33ff6c56728086356c66af Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Thu, 2 May 2024 17:54:09 +0200 Subject: [PATCH] Add msmtp to send notifications via email Reviewed-by: Aleix Roca Nonell --- m/hut/configuration.nix | 1 + m/hut/msmtp.nix | 24 ++++++++++++++++++++++++ secrets/jungle-robot-password.age | 10 ++++++++++ secrets/secrets.nix | 1 + 4 files changed, 36 insertions(+) create mode 100644 m/hut/msmtp.nix create mode 100644 secrets/jungle-robot-password.age diff --git a/m/hut/configuration.nix b/m/hut/configuration.nix index 09fba85..c7ec747 100644 --- a/m/hut/configuration.nix +++ b/m/hut/configuration.nix @@ -14,6 +14,7 @@ ./nix-serve.nix ./public-inbox.nix ./gitea.nix + ./msmtp.nix #./pxe.nix ]; diff --git a/m/hut/msmtp.nix b/m/hut/msmtp.nix new file mode 100644 index 0000000..aaeaf5d --- /dev/null +++ b/m/hut/msmtp.nix @@ -0,0 +1,24 @@ +{ config, lib, ... }: +{ + age.secrets.jungleRobotPassword = { + file = ../../secrets/jungle-robot-password.age; + group = "gitea"; + mode = "440"; + }; + + programs.msmtp = { + enable = true; + accounts = { + default = { + auth = true; + tls = true; + tls_starttls = false; + port = 465; + host = "mail.bsc.es"; + user = "jungle-robot"; + passwordeval = "cat ${config.age.secrets.jungleRobotPassword.path}"; + from = "jungle-robot@bsc.es"; + }; + }; + }; +} diff --git a/secrets/jungle-robot-password.age b/secrets/jungle-robot-password.age new file mode 100644 index 0000000..de9bf22 --- /dev/null +++ b/secrets/jungle-robot-password.age @@ -0,0 +1,10 @@ +age-encryption.org/v1 +-> ssh-ed25519 HY2yRg 3L1Y5upc5qN6fgiFAox5rD/W8n0eQUv5mT39QAdO5Ac +XkWsmPmzRgHjsvJgsDKJRgHZ7/sBZFmd1Doppj/y390 +-> ssh-ed25519 CAWG4Q v03Qr+fckdIpsxvQG/viKxlF8WNpO4XUe//QcPzH4k0 +afUwi3ccDCRfUxPDdF7ZkoL+0UX1XwqVtiyabDWjVQk +-> ssh-ed25519 MSF3dg c2hEUk4LslJpiL7v/4UpT8fK7ZiBJ8+uRhZ/vBoRUDE +YX9EpnJpHo1eDsZtapTVY6jD+81kb588Oik4NoY9jro +--- LhUkopNtCsyHCLzEYzBFs+vekOkAR4B3VBaiMF/ZF8w +o˝CHyLؔItMIױsM\1-KG: +gbpFӶ%Y \ No newline at end of file diff --git a/secrets/secrets.nix b/secrets/secrets.nix index debaccc..9844734 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -11,6 +11,7 @@ in "ovni-token.age".publicKeys = hut; "nosv-token.age".publicKeys = hut; "nix-serve.age".publicKeys = hut; + "jungle-robot-password.age".publicKeys = hut; "ceph-user.age".publicKeys = safe; "munge-key.age".publicKeys = safe;