~sumner/nixos-configuration

27ea1066f523953771f1beb4f9314248bd72807f — Sumner Evans 6 months ago 432b388 new-servers
fix synapse init
2 files changed, 11 insertions(+), 8 deletions(-)

M modules/services/matrix/synapse.nix
M modules/services/pr-tracker.nix
M modules/services/matrix/synapse.nix => modules/services/matrix/synapse.nix +10 -7
@@ 35,19 35,22 @@ lib.mkIf synapseCfg.enable {
  # Make sure that Postgres is setup for Synapse.
  services.postgresql = {
    enable = true;
    ensureDatabases = [ "matrix-synapse" ];
    ensureUsers = [
      {
        name = "matrix-synapse";
        ensurePermissions."DATABASE \"matrix-synapse\"" = "ALL PRIVILEGES";
      }
    ];
    initialScript = pkgs.writeText "synapse-init.sql" ''
      CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
      CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
        TEMPLATE template0
        LC_COLLATE = "C"
        LC_CTYPE = "C";
    '';
  };

  # Set up nginx to forward requests properly.
  services.nginx.enable = true;
  services.nginx.virtualHosts = {
    ${config.networking.domain} = {
      enableACME = true;
      forceSSL = true;

      locations."= /.well-known/matrix/server".extraConfig =
        let
          server = { "m.server" = "${matrixDomain}:443"; };

M modules/services/pr-tracker.nix => modules/services/pr-tracker.nix +1 -1
@@ 61,7 61,7 @@ in
      description = "Clone nixpkgs.";
      after = [ "network.target" ];
      serviceConfig = {
        ExecStart = ''
        ExecStart = pkgs.writeShellScript "clone-nixpkgs" ''
          if [[ ! -d ${nixpkgsDir} ]]; then
            ${pkgs.git}/bin/git clone \
              https://github.com/NixOS/nixpkgs.git \