Files
dotfiles/nixos/tako/services/matrix/cinny.nix
servius 62072e71ea
All checks were successful
Flake checker / Build Nix targets (push) Successful in 9m27s
feat: Update cinny
2026-03-11 13:32:24 +05:30

67 lines
1.4 KiB
Nix

{
pkgs,
config,
inputs,
...
}: let
base_domain = "darksailor.dev";
cinnyConfig = builtins.toJSON {
defaultHomeserver = 0;
homeserverList = ["darksailor.dev" "matrix.org"];
allowCustomHomeservers = false;
hashRouter = {
enabled = true;
basename = "/";
};
};
cinnyConfigFile = pkgs.writeText "cinny-config.json" cinnyConfig;
cinny = with pkgs;
buildNpmPackage rec {
pname = "cinny-unwrapped";
version = "4.11.0";
src = inputs.cinny;
nodejs = nodejs_22;
npmDepsHash = "sha256-+V0neNe3h21nEgqj6cLBwUzN/dOtePM2VlzN/jx4lB4=";
nativeBuildInputs = [
python3
pkg-config
];
buildInputs =
[
pixman
cairo
pango
]
++ lib.optionals stdenv.hostPlatform.isDarwin [giflib];
installPhase = ''
runHook preInstall
cp -r dist $out
runHook postInstall
'';
};
in {
services.caddy.virtualHosts = {
"matrix.${base_domain}".extraConfig = ''
handle /_matrix/* {
reverse_proxy /_matrix/* localhost:${toString (builtins.elemAt config.services.matrix-tuwunel.settings.global.port 0)}
}
handle_path /config.json {
file_server
root ${cinnyConfigFile}
}
handle {
root * ${cinny}
try_files {path} /index.html
file_server
}
'';
};
}