-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflake.nix
More file actions
75 lines (68 loc) · 2.19 KB
/
flake.nix
File metadata and controls
75 lines (68 loc) · 2.19 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
description = "smtp-mail";
nixConfig = {
extra-substituters = [ "https://cache.iog.io" ];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
];
};
inputs = {
nixpkgs.follows = "haskell-nix/nixpkgs-unstable";
haskell-nix.url = "github:input-output-hk/haskell.nix";
};
outputs = { self, nixpkgs, haskell-nix, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
inherit (haskell-nix) config;
overlays = [ haskell-nix.overlay ];
};
project = pkgs.haskell-nix.cabalProject' {
src = ./.;
compiler-nix-name = "ghc98";
};
certs =
import "${nixpkgs}/nixos/tests/common/acme/server/snakeoil-certs.nix";
in {
checks.${system}.smtp-mail = pkgs.testers.nixosTest {
name = "smtp-mail";
nodes.machine = { config, pkgs, ... }: {
imports = [ "${nixpkgs}/nixos/tests/common/user-account.nix" ];
services.postfix = {
enable = true;
enableSubmission = true;
enableSubmissions = true;
settings.main = {
tlsTrustedAuthorities = "${certs.ca.cert}";
smtpd_tls_chain_files = [
certs."acme.test".key
certs."acme.test".cert
];
};
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 = [
project.hsPkgs.integration-test.components.exes.integration-test
];
};
testScript = ''
machine.wait_for_unit("postfix.service")
machine.succeed("integration-test")
'';
};
};
}