summary refs log tree commit diff
path: root/host/Rory-ovh/services/containers/syntest1/container.nix
blob: da77a2daece6c3469698977fec29259b80c066a5 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
  nixpkgs-master,
  matrix-synapse-unwrapped-patched,
  ...
}:

{
  privateNetwork = true;
  autoStart = true;
  specialArgs = {
    inherit matrix-synapse-unwrapped-patched;
  };
  nixpkgs = nixpkgs-master;
  config =
    {
      lib,
      pkgs,
      matrix-synapse-unwrapped-patched,
      ...
    }:
    {
      imports = [
        ../shared.nix
        ./root.nix
        ./services/synapse/synapse-main.nix
        ./services/postgres.nix
        (
          {
            pkgs,
            lib,
            config,
            ...
          }:

          {
            options.virtualisation = {
              isVmVariant = lib.mkOption {
                default = false;
                example = true;
                description = "Whether this build is a VM build.";
                type = lib.types.bool;
              };
            };
            config = {
              virtualisation.vmVariant = {
                virtualisation.isVmVariant = true;
              };
            };
          }
        )
      ];

      nixpkgs.overlays = [
        (final: prev: {
          matrix-synapse-unwrapped = matrix-synapse-unwrapped-patched;
        })
      ];
      networking.firewall.allowedTCPPorts = [ 8008 ];
    };
  hostAddress = "192.168.100.1";
  localAddress = "192.168.100.20";

  bindMounts."postgres" = {
    hostPath = "/data/dedicated/postgres-syntest1";
    mountPoint = "/data/postgres";
    isReadOnly = false;
  };
}