Files
dotfiles/nixos/tako/services/matrix/cinny.nix
servius 3b23c25509
Some checks failed
Flake checker / Build Nix targets (push) Has been cancelled
feat: Update stuff
2026-03-09 16:54:14 +05:30

75 lines
1.6 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.10.5";
# src = fetchFromGitHub {
# owner = "cinnyapp";
# repo = "cinny";
# rev = "dev";
# # tag = "v${version}";
# hash = "sha256-2qxmlj4IK6twDh27R6qMJDmYSfsWoofVGuRHxSP72f0=";
# };
src = inputs.cinny;
nodejs = nodejs_22;
npmDepsHash = "sha256-qyQ0SXkPSUES/tavKzPra0Q+ZnU9qHvkTC1JgAjL0o8=";
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
}
'';
};
}