~sumner/nixos-configuration

ref: 7e558d0d52b4201b2e0b7de2eb1a2d75fab02a2e nixos-configuration/host-configurations/nevarro.nix -rw-r--r-- 2.6 KiB
7e558d0dSumner Evans matrix-synapse: email config for nevarro 2 months ago
                                                                                
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{ config, lib, ... }: with lib; {
  hardware.isServer = true;

  # Set the hostname
  networking.hostName = "nevarro";
  networking.domain = "nevarro.space";

  networking.interfaces.eth0.useDHCP = true;

  # Enable a lot of swap since we have enough disk. This way, if Airsonic eats
  # memory, it won't crash the box.
  swapDevices = [
    {
      device = "/var/swapfile";
      size = 4096;
    }
  ];

  fileSystems = {
    "/mnt/nevarro-postgresql-data" = { device = "/dev/disk/by-id/scsi-0Linode_Volume_nevarro-postgresql-data"; fsType = "ext4"; };
  };

  # Websites
  services.nginx.websites = [
    { hostname = "nevarro.space"; }
  ];

  ############
  # Services #
  ############
  services.grafana.enable = true;
  services.healthcheck.checkId = "0a1a1c13-e65d-4968-a498-c5709dcb2ae8";
  services.logrotate.enable = true;

  # Heisenbridge
  services.heisenbridge = {
    enable = true;
  } // (import ../secrets/matrix/appservices/heisenbridge.nix);

  # LinkedIn <-> Matrix Bridge
  services.linkedin-matrix = {
    enable = true;
  } // (import ../secrets/matrix/appservices/linkedin-matrix.nix);

  # Longview
  services.longview.enable = true;
  services.longview.apiKeyFile = ../secrets/longview/nevarro;

  # Mjolnir
  services.mjolnir.enable = true;

  # Mumble
  services.murmur.enable = true;

  # PosgreSQL
  services.postgresql.enable = true;
  services.postgresql.dataDir = "/mnt/nevarro-postgresql-data/postgresql/11.1";
  services.postgresqlBackup.enable = true;

  # Quotesfilebot
  services.quotesfilebot.enable = true;
  services.quotesfilebot.passwordFile = "/etc/nixos/secrets/matrix/bots/quotesfilebot";

  # Restic backup
  services.backup.healthcheckId = "5af26654-5ca7-405a-b8c4-e00a2fc6a5b0";
  services.backup.healthcheckPruneId = "d58fb3c6-532b-4db2-9538-c3a5908f3d2c";

  # Standupbot
  services.standupbot.enable = true;
  services.standupbot.passwordFile = "/etc/nixos/secrets/matrix/bots/standupbot";

  # Synapse
  services.matrix-synapse-custom = {
    enable = true;
    registrationSharedSecretFile = ../secrets/matrix/registration-shared-secret/nevarro;
    emailCfg = {
      smtp_host = "smtp.migadu.com";
      smtp_port = 587;
      require_transport_security = true;

      smtp_user = "matrix@nevarro.space";
      smtp_pass = removeSuffix "\n" (readFile ../secrets/matrix/nevarro-smtp-pass);

      notif_from = "Nevarro %(app)s Admin <matrix@nevarro.space>";
      app_name = "Matrix";
      enable_notifs = true;
      notif_for_new_users = false;
      invite_client_location = "https://app.element.io";
    };
  };
  services.cleanup-synapse.environmentFile = "/etc/nixos/secrets/matrix/cleanup-synapse/bespin";
}