Skip to content

Commit

Permalink
nixos/opensmtpd: run nixfmt as requested by ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekleog committed Dec 25, 2024
1 parent 0b0a21c commit 40f9205
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
8 changes: 5 additions & 3 deletions nixos/modules/services/mail/opensmtpd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ in
source = "${cfg.package}/bin/smtpctl";
};

services.mail.sendmailSetuidWrapper = lib.mkIf cfg.setSendmail
(security.wrappers.smtpctl // {
services.mail.sendmailSetuidWrapper = lib.mkIf cfg.setSendmail (
security.wrappers.smtpctl
// {
source = "${sendmail}/bin/sendmail";
program = "sendmail";
});
}
);

systemd.tmpfiles.rules = [
"d /var/spool/smtpd 711 root - - -"
Expand Down
36 changes: 19 additions & 17 deletions nixos/tests/opensmtpd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@ import ./make-test-python.nix {
}
];
};
environment.systemPackages = let
testSendmail = pkgs.writeScriptBin "test-sendmail" ''
#!/bin/sh
set -euxo pipefail
echo "========= SENDING" >&2
${pkgs.system-sendmail}/bin/sendmail -v -f alice@smtp1 bob@smtp2 >&2 <<EOF
From: alice@smtp1
To: bob@smtp2
Subject: Sendmail Test
environment.systemPackages =
let
testSendmail = pkgs.writeScriptBin "test-sendmail" ''
#!/bin/sh
set -euxo pipefail
echo "========= SENDING" >&2
${pkgs.system-sendmail}/bin/sendmail -v -f alice@smtp1 bob@smtp2 >&2 <<EOF
From: alice@smtp1
To: bob@smtp2
Subject: Sendmail Test
Hello World
EOF
echo "=========== FINISHED SENDING" >&2
'';
in [
pkgs.opensmtpd
testSendmail
];
Hello World
EOF
echo "=========== FINISHED SENDING" >&2
'';
in
[
pkgs.opensmtpd
testSendmail
];
services.opensmtpd = {
enable = true;
extraServerArgs = [ "-v" ];
Expand Down

0 comments on commit 40f9205

Please sign in to comment.