-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
59 lines (52 loc) · 1.85 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
description = "smtp-mail";
inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; };
outputs = { self, nixpkgs }: {
overlays.default = final: prev: {
haskellPackages = prev.haskellPackages.override {
overrides = self: prev: {
smtp-mail = self.callCabal2nix "smtp-mail" ./. { };
integration-test = self.callCabal2nix "integration-test"
./nix-integration-test/integration-test { };
};
};
};
checks.x86_64-linux.smtp-mail = let
pkgs = nixpkgs.legacyPackages.x86_64-linux.extend self.overlays.default;
certs =
import "${nixpkgs}/nixos/tests/common/acme/server/snakeoil-certs.nix";
in pkgs.nixosTest {
name = "smtp-mail";
nodes.machine = { config, pkgs, ... }: {
imports = [ "${nixpkgs}/nixos/tests/common/user-account.nix" ];
services.postfix = {
enable = true;
enableSubmission = true;
enableSubmissions = true;
tlsTrustedAuthorities = "${certs.ca.cert}";
sslCert = "${certs."acme.test".cert}";
sslKey = "${certs."acme.test".key}";
submissionOptions = {
smtpd_sasl_auth_enable = "yes";
smtpd_client_restrictions = "permit";
milter_macro_daemon_name = "ORIGINATING";
};
submissionsOptions = {
smtpd_sasl_auth_enable = "yes";
smtpd_client_restrictions = "permit";
milter_macro_daemon_name = "ORIGINATING";
};
};
security.pki.certificateFiles = [ certs.ca.cert ];
networking.extraHosts = ''
127.0.0.1 acme.test
'';
environment.systemPackages = [ pkgs.haskellPackages.integration-test ];
};
testScript = ''
machine.wait_for_unit("postfix.service")
machine.succeed("integration-test")
'';
};
};
}