@cryptotaxi247 / infra / commits / 3eb6cdfb

Backup simple nixos mailserver + freescout

Now that we support storing email for IMAP accounts and freescout for collaborative inboxes, umbriel has state that we care about and should back up. I made a best guess here about what's important to back up for freescout. See this upstream issue where I asked for confirmation that I got it right: <https://cyberchaos.dev/e1mo/freescout-nix-flake/-/issues/7> For SNM, I followed their [Backup Guide](https://nixos-mailserver.readthedocs.io/en/latest/backup-guide.html). I opted to only back up our `mailDirectory`. We haven't enabled `enableManageSieve`. I'm not sure if we should back up our spam and ham training data. We don't need to back up our dkim data, as those secrets are encrypted and version controlled. refs: https://github.com/NixOS/infra/issues/700

Jeremy Fleischman committed Sep 22, 2025 at 16:55 UTC 3eb6cdfba120ae24ccc154a0e6d393440f22a901
2 files changed +17 -1
non-critical-infra/modules/mailserver/default.nix
+3
@@ -28,6 +28,9 @@
28 ];
29 };
30
31 + # https://nixos-mailserver.readthedocs.io/en/latest/backup-guide.html
32 + services.backup.includes = [ config.mailserver.mailDirectory ];
33 +
34 sops.secrets."nixos.org.mail.key" = {
35 format = "binary";
36 owner = "rspamd";
non-critical-infra/modules/mailserver/freescout.nix
+14 -1
@@ -16,7 +16,10 @@
16
17 settings.APP_KEY._secret = config.sops.secrets.freescout-app-key.path;
18
19 - databaseSetup.enable = true;
19 + databaseSetup = {
20 + enable = true;
21 + kind = "pgsql";
22 + };
23
24 nginx = {
25 forceSSL = true;
@@ -24,6 +27,16 @@
27 };
28 };
29
30 + services.postgresqlBackup = {
31 + enable = true;
32 + databases = [ "freescout" ];
33 + };
34 +
35 + services.backup.includes = [
36 + "/var/lib/freescout"
37 + config.services.postgresqlBackup.location
38 + ];
39 +
40 # How to generate:
41 #
42 # $ cd non-critical-infra