1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-08-01 12:37:46 +00:00

cinny: use .patch instead of whole repo

This commit is contained in:
RGBCube 2025-06-15 00:26:39 +03:00
parent 9adc4abe96
commit 0e70f7c08d
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M
3 changed files with 331 additions and 50 deletions

View file

@ -0,0 +1,70 @@
{ config, lib, pkgs, ... }: let
inherit (lib) flip merge;
inherit (lib.strings) toJSON;
fqdn = "cinny.rgbcu.be";
root = pkgs.cinny;
cinnyConfig = {
allowCustomHomeservers = false;
homeserverList = [ "rgbcu.be" ];
defaultHomeserver = 0;
hashRouter = {
enabled = false;
basename = "/";
};
featuredCommunities = {
openAsDefault = false;
servers = [
"rgbcu.be"
"matrix.org"
"privatevoid.net"
"notashelf.dev"
"outfoxxed.me"
];
spaces = [
"#nixos-fallout:privatevoid.net"
"#ferronweb:matrix.org"
];
rooms = [
"#ferronweb-general:matrix.org"
"#ferronweb-development:matrix.org"
];
};
};
in {
nixpkgs.overlays = [(self: super: {
cinny-unwrapped = super.cinny-unwrapped.overrideAttrs (old: {
patches = old.patches or [] ++ [
./all-styles.patch
];
});
})];
services.nginx.virtualHosts.${fqdn} = merge config.services.nginx.sslTemplate {
inherit root;
locations."= /config.json".extraConfig = /* nginx */ ''
default_type application/json;
return 200 '${toJSON cinnyConfig}';
'';
extraConfig = /* nginx */ ''
rewrite ^/config.json$ /config.json break;
rewrite ^/manifest.json$ /manifest.json break;
rewrite ^/sw.js$ /sw.js break;
rewrite ^/pdf.worker.min.js$ /pdf.worker.min.js break;
rewrite ^/public/(.*)$ /public/$1 break;
rewrite ^/assets/(.*)$ /assets/$1 break;
rewrite ^(.+)$ /index.html break;
'';
};
}