1 files changed, 33 insertions, 0 deletions
diff --git a/host/Rory-ovh/services/containers/spacebar/root.nix b/host/Rory-ovh/services/containers/spacebar/root.nix
new file mode 100644
index 0000000..cb7d3cd
--- /dev/null
+++ b/host/Rory-ovh/services/containers/spacebar/root.nix
@@ -0,0 +1,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'";
+ # };
+ # };
+}
|