From 690ea06e1c9efc4e24f490b8de266f47fae3a242 Mon Sep 17 00:00:00 2001 From: Moritz 'e1mo' Fromm Date: Sun, 11 Dec 2022 13:28:31 +0100 Subject: [PATCH] Deploy to production + matrix well-known --- hosts/shirley/configuration.nix | 2 +- services/website.nix | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hosts/shirley/configuration.nix b/hosts/shirley/configuration.nix index afefcbd..3a83439 100644 --- a/hosts/shirley/configuration.nix +++ b/hosts/shirley/configuration.nix @@ -1,5 +1,5 @@ { pkgs, baseDomain, ... }: { - _module.args.baseDomain = "dev.chaos.jetzt"; + _module.args.baseDomain = "chaos.jetzt"; imports = [ ./hardware-config.nix diff --git a/services/website.nix b/services/website.nix index b4b8d95..f2ab13b 100644 --- a/services/website.nix +++ b/services/website.nix @@ -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 + "/"; }; }; } \ No newline at end of file