summary refs log tree commit diff
path: root/host/Rory-ovh/services/containers/spacebar/root.nix
blob: cb7d3cd2915bf84d434624bdf48a3d44129e9bd4 (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
{ pkgs, ... }:

{
  networking.useHostResolvConf = true;

  networking.hosts = {
    "192.168.100.1" = [
      "matrix.rory.gay"
      "rory.gay"
    ];
  };

  networking.firewall = {
    enable = true;
    allowedTCPPorts = [
      3001
      3002
      3003
    ];
  };

  # check that we can reach the database server before starting the service
  #systemd.services."spacebar-apply-migrations" =
  #  let
  #    address = "192.168.100.1";
  #  in
  #  {
  #    path = [ pkgs.netcat pkgs.bash ];
  #    serviceConfig = {
  #      ExecStartPre = "${pkgs.bash}/bin/sh -c 'until ${pkgs.netcat}/bin/nc -z ${address} 5432; do echo \"Waiting for database server...\"; sleep 0.2; done'";
  #    };
  #  };
}