summary refs log tree commit diff
path: root/host/Spacebar-nginx/configuration.nix
blob: 54884b94c27b16d5fed97f517d915a05ffb14743 (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
{ config, pkgs, lib, ... }:

{
  imports =
    [
      ../../modules/base.nix
    ];

  networking = {
    hostName = "Spacebar-nginx";
    interfaces.ens18.ipv4.addresses = [ { 
      address = "192.168.1.2";
      prefixLength = 24;
    } ];
    interfaces.ens19.ipv4.addresses = [ {
      address = "10.10.11.2";
      prefixLength = 16;
    } ];
  };

  services = {
    nginx = {
      enable = true;
      package = pkgs.nginxQuic;
      recommendedProxySettings = true;
      recommendedTlsSettings = true;
      virtualHosts = {
        "matrix.thearcanebrony.net" = import ./hosts/thearcanebrony.net/matrix.nix;

        "mail.spacebar.chat" = import ./hosts/spacebar.chat/mail.nix;

        #local only
        "secrets.spacebar.local" = import ./hosts/spacebar.local/secrets.nix { inherit lib config; };
      };
    };
  };
  systemd.services.nginx.requires = [ "data.mount" ];
  security.acme.acceptTerms = true;
  security.acme.defaults.email = "chris@spacebar.chat";

  system.stateVersion = "22.11"; # DO NOT EDIT!
}