|
|
|
@ -1,12 +1,12 @@ |
|
|
|
|
# adapted from https://nixos.org/manual/nixos/stable/index.html#module-services-matrix |
|
|
|
|
{ modulesPath, config, lib, pkgs, ... }: |
|
|
|
|
let |
|
|
|
|
let |
|
|
|
|
matrix-registration = import ../../matrix-registration/default.nix; |
|
|
|
|
storage-device = "/dev/disk/by-id/scsi-0DO_Volume_matrix-storage"; |
|
|
|
|
storage-dir = "/opt/matrix-data"; |
|
|
|
|
storage-dir = "/srv/matrix-data"; |
|
|
|
|
matrix-reg-dir = "${storage-dir}/matrix-registration"; |
|
|
|
|
matrix-reg-key = (builtins.readFile ./matrix_reg_key); |
|
|
|
|
fqdn = |
|
|
|
|
fqdn = |
|
|
|
|
let |
|
|
|
|
join = hostName: domain: hostName + lib.optionalString (domain != null) ".${domain}"; |
|
|
|
|
in join config.networking.hostName config.networking.domain; |
|
|
|
@ -23,7 +23,7 @@ in { |
|
|
|
|
(builtins.readFile "/home/mike/.ssh/id_mops.pub") |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
### app specific config |
|
|
|
|
### app specific config |
|
|
|
|
|
|
|
|
|
# mount DigitalOcean volume for use by postgres |
|
|
|
|
fileSystems."${storage-dir}" = { |
|
|
|
@ -35,7 +35,7 @@ in { |
|
|
|
|
domain = "waffle.farm"; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
services.postgresql = { |
|
|
|
|
services.postgresql = { |
|
|
|
|
enable = true; |
|
|
|
|
dataDir = "${storage-dir}/db"; |
|
|
|
|
|
|
|
|
@ -128,6 +128,7 @@ in { |
|
|
|
|
server_name = config.networking.domain; |
|
|
|
|
registration_shared_secret = matrix-reg-key; |
|
|
|
|
extraConfig = '' |
|
|
|
|
allow_public_rooms_over_federation: true |
|
|
|
|
auto_join_rooms: |
|
|
|
|
- "#cryptic-chat:waffle.farm" |
|
|
|
|
''; |
|
|
|
@ -162,6 +163,7 @@ in { |
|
|
|
|
systemd.services.matrix-registration = let |
|
|
|
|
configFile = pkgs.writeText "matrix-reg-config.yaml" '' |
|
|
|
|
server_location: 'https://matrix.waffle.farm:443' |
|
|
|
|
base_url: 'waffle.farm' |
|
|
|
|
server_name: 'waffle.farm' |
|
|
|
|
shared_secret: '${matrix-reg-key}' |
|
|
|
|
riot_instance: 'chat.waffle.farm' |
|
|
|
|