Skip to content

Commit

Permalink
setup for matrix server
Browse files Browse the repository at this point in the history
  • Loading branch information
Mast3rwaf1z committed May 8, 2024
1 parent 8925c3b commit d7037ac
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
./users.nix
./nginx.nix
./fikien.nix
./matrix.nix

../modules
];
Expand Down Expand Up @@ -34,9 +35,10 @@

virtualisation.vmVariant.virtualisation.forwardPorts = [
{ from = "host"; host.port = 2222; guest.port = 22; }
{ from = "host"; host.port = 8888; guest.port = 80; }
{ from = "host"; host.port = 80; guest.port = 80; }
];

# #FRITFIT (custom shiz)
services.stregsystemet.enable = true;
fklub.matrix.enable = true;
}
20 changes: 20 additions & 0 deletions system/matrix.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{pkgs, lib, config, ...}: {
options = {
fklub.matrix.port = lib.mkOption {
type = lib.types.int;
default = 6167;
};
fklub.matrix.enable = lib.mkOption {
type = lib.types.bool;
default = false;
};
};

config.services.matrix-conduit = {
enable = config.fklub.matrix.enable;
settings.global.port = config.fklub.matrix.port;
settings.global.server_name = config.fklub.domain;
settings.global.database_backend = "rocksdb";
settings.global.allow_registration = true;
};
}
11 changes: 11 additions & 0 deletions system/nginx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@
''}";
root = "/.";
};
"matrix.${config.fklub.domain}" = {
locations."/" = {
proxyPass = "http://localhost:${builtins.toString config.fklub.matrix.port}";
proxyWebsockets = true;
};
locations."/_matrix/" = {
proxyPass = "http://localhost:${builtins.toString config.fklub.matrix.port}";
proxyWebsockets = true;
};
};
};

};
}

0 comments on commit d7037ac

Please sign in to comment.