From 78c01df6de696853ccd49de4893b3d05b042ca3c Mon Sep 17 00:00:00 2001 From: RGBCube Date: Sun, 8 Jun 2025 21:11:26 +0300 Subject: [PATCH] cinny: configure --- hosts/best/cinny.nix | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/hosts/best/cinny.nix b/hosts/best/cinny.nix index 8e99ed1..91e171f 100644 --- a/hosts/best/cinny.nix +++ b/hosts/best/cinny.nix @@ -1,8 +1,42 @@ { 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 = flip self.callPackage {} ({ @@ -62,6 +96,11 @@ in { 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;