Skip to content

Commit 4833095

Browse files
committed
Reload postfix-setup when mailing list membership changes
This fixes NixOS#505
1 parent 71f6fc1 commit 4833095

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

flake.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

non-critical-infra/modules/mailserver/mailing-lists.nix

+13-8
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,19 @@ in
4848
}) secretFiles
4949
);
5050

51-
# Whenever this changes, we need to manually restart the `postfix-setup`
52-
# service for postfix to notice the change.
53-
# TODO: <https://github.com/NixOS/infra/issues/505> tracks fixing this
54-
sops.templates."postfix-virtual-mailing-lists".content = lib.concatStringsSep "\n" (
55-
lib.mapAttrsToList (
56-
name: members: "${name} ${lib.concatStringsSep ", " members}"
57-
) listsWithSecretPlaceholders
58-
);
51+
sops.templates."postfix-virtual-mailing-lists" = {
52+
content = lib.concatStringsSep "\n" (
53+
lib.mapAttrsToList (
54+
name: members: "${name} ${lib.concatStringsSep ", " members}"
55+
) listsWithSecretPlaceholders
56+
);
57+
58+
# Need to restart postfix-setup to rerun `postmap` and generate updated `.db`
59+
# files whenever mailing list membership changes.
60+
# This could go away if sops-nix gets support for "input addressed secret
61+
# paths": https://github.com/Mic92/sops-nix/issues/648
62+
restartUnits = [ "postfix-setup.service" ];
63+
};
5964

6065
services.postfix.mapFiles.virtual-mailing-lists =
6166
config.sops.templates."postfix-virtual-mailing-lists".path;

0 commit comments

Comments
 (0)