This repository has no description
1.6 kB
41 lines
1{ pkgs, ... }:
2let
3 # Cinny has no thread overview UI. Carry smokku's "threads-ui" drawer
4 # (PR cinnyapp/cinny#2787, closed only due to Cinny's PR freeze during their
5 # SDK rewrite) as a patch on top of the packaged release. Regenerate against
6 # the new tag on each cinny bump; the patch touches ~16 files, conflicts have
7 # historically been limited to RoomViewHeader.tsx.
8 cinny-threads = pkgs.cinny.override {
9 cinny-unwrapped = pkgs.cinny-unwrapped.overrideAttrs (old: {
10 patches = (old.patches or [ ]) ++ [ ./cinny-threads-ui.patch ];
11 # Quack (https://www.youtube.com/watch?v=Fw3RB7xnb80) instead of the
12 # stock chime; vite content-hashes it into assets/ at build time.
13 postPatch = (old.postPatch or "") + ''
14 cp ${./notification.ogg} public/sound/notification.ogg
15 '';
16 });
17 conf = {
18 defaultHomeserver = 0;
19 homeserverList = [ "lassul.us" ];
20 allowCustomHomeservers = true;
21 };
22 };
23in
24{
25 services.nginx.virtualHosts."matrix.lassul.us" = {
26 root = cinny-threads;
27 locations = {
28 "/".tryFiles = "$uri /index.html";
29 # Store files have mtime=1970; without an explicit Cache-Control a browser
30 # may heuristically cache the entry HTML for a long time and not pick up a
31 # new build on reload. Force revalidation of index.html (cheap via etag),
32 # and let the content-hashed assets cache hard.
33 "= /index.html".extraConfig = ''
34 add_header Cache-Control "no-cache";
35 '';
36 "/assets/".extraConfig = ''
37 add_header Cache-Control "public, max-age=31536000, immutable";
38 '';
39 };
40 };
41}