summary refs log tree commit diff stats
path: root/flake.nix
blob: 554e168823bde53b3958473d8d59474cebd44bed (plain) (blame)
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
# vim: ts=2
{
  description = "Nixos server config";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11-small";
    simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-22.11";
  };

  outputs = {
    self,
    nixpkgs,
    simple-nixos-mailserver,
    ...
  } @ attrs: {
    nixosConfigurations."server1" = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      specialArgs = attrs;
      modules = [
        ./hosts/server1/configuration.nix
        simple-nixos-mailserver.nixosModule
        {
          mailserver = {
            enable = true;
            fqdn = "server1.vhack.eu";
            domains = ["vhack.eu"];

            mailDirectory = "/srv/mail/vmail";
            dkimKeyDirectory = "/srv/mail/dkim";
            backup.snapshotRoot = "/srv/mail/backup";

            loginAccounts = {
              "sils@vhack.eu" = {
                hashedPasswordFile = "/srv/mail/.secrets/silsmailpswd";
              };
            };

            extraVirtualAliases = {
              "abuse@vhack.eu" = ["sils@vhack.eu"];
              "postmaster@vhack.eu" = ["sils@vhack.eu"];
              "admin@vhack.eu" = ["sils@vhack.eu"];
            };

            sieveDirectory = "/srv/mail/sieve";
            keyFile = "/var/lib/acme/server1.vhack.eu/key.pem";
            certificateScheme = 1;
            certificateFile = "/var/lib/acme/server1.vhack.eu/fullchain.pem";
          };
        }
      ];
    };
  };
}