Deploy to production + matrix well-known

This commit is contained in:
Moritz 'e1mo' Fromm 2022-12-11 13:28:31 +01:00
parent d782f28bec
commit 690ea06e1c
No known key found for this signature in database
GPG key ID: 1D5D79A439E787F1
2 changed files with 12 additions and 2 deletions

View file

@ -1,5 +1,5 @@
{ pkgs, baseDomain, ... }: {
_module.args.baseDomain = "dev.chaos.jetzt";
_module.args.baseDomain = "chaos.jetzt";
imports = [
./hardware-config.nix

View file

@ -1,4 +1,12 @@
{ pkgs, baseDomain, ...}: {
{ lib, pkgs, config, baseDomain, ...}:
let
matrixWellKnown = {
client."m.homeserver".base_url = "https://matrix.${baseDomain}/";
server."m.server" = "matrix.${baseDomain}:443";
};
toJSONFile = name: value: pkgs.writeText name (builtins.toJSON value);
matrixWellKnownDir = pkgs.linkFarm "matrix-well-known" (builtins.mapAttrs toJSONFile matrixWellKnown);
in {
services.nginx = {
enable = true;
enableReload = true;
@ -11,8 +19,10 @@
default = true;
enableACME = true;
forceSSL = true;
serverAliases = [ "www.${baseDomain}" ];
# TODO: Change this to be deployed by some sort of CI + rsync so we don't need to always update the package version
locations."/".root = pkgs.chaos-jetzt-website-pelican;
locations."/.well-known/matrix/".alias = matrixWellKnownDir + "/";
};
};
}