NixOS-Config/nixos/server/package-configs/cinny/default.nix

47 lines
951 B
Nix
Raw Normal View History

2024-03-31 22:06:47 +02:00
{
config,
pkgs,
inputs,
lib,
...
}: let
port = 2143;
configFile =
pkgs.writeText "config.json"
''
{
"defaultHomeserver": 2,
"homeserverList": [
"matrix.gladtherescake.eu"
],
"allowCustomHomeservers": false
}
'';
2024-03-31 22:06:47 +02:00
in {
2024-03-31 22:28:45 +02:00
#TODO: set default server and disable changing that
2024-03-31 22:06:47 +02:00
virtualisation.oci-containers.containers."cinny" = {
autoStart = true;
ports = ["${toString port}:80"];
2024-04-01 18:15:08 +02:00
volumes = [
"${configFile}:/app/config.json"
2024-04-01 18:15:08 +02:00
];
image = "ajbura/cinny:latest";
2024-03-31 22:06:47 +02:00
};
services.nginx = {
enable = true;
virtualHosts = {
"cinny.gladtherescake.eu" = {
## Force HTTP redirect to HTTPS
forceSSL = true;
## LetsEncrypt
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:${toString port}";
proxyWebsockets = true;
};
};
};
};
}