From a9c0cc8c1c6005945a764cfea21001b9e8a23904 Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Thu, 7 Apr 2022 02:20:40 +0000 Subject: [PATCH] Update dingserver --- hosts/dingserver/bot.nix | 39 ------------------------------ hosts/dingserver/caddy.nix | 1 + hosts/dingserver/configuration.nix | 6 +++-- hosts/dingserver/synapse.nix | 37 ++++++++++++++-------------- hosts/dingserver/syncthing.nix | 6 +++++ 5 files changed, 30 insertions(+), 59 deletions(-) delete mode 100644 hosts/dingserver/bot.nix create mode 100644 hosts/dingserver/syncthing.nix diff --git a/hosts/dingserver/bot.nix b/hosts/dingserver/bot.nix deleted file mode 100644 index 43ff2d5..0000000 --- a/hosts/dingserver/bot.nix +++ /dev/null @@ -1,39 +0,0 @@ -{pkgs, ... }: - -{ - services.mautrix-facebook = { - enable = true; - - # file containing the appservice and telegram tokens - #environmentFile = /etc/secrets/mautrix-telegram.env; - - # The appservice is pre-configured to use SQLite by default. - # It's also possible to use PostgreSQL. - settings = { - homeserver = { - address = "http://localhost:8008"; - domain = "broccoli.town"; - }; - appservice = { - address = "https://localhost:29319"; - bot_username = "messenger_bot"; - database = "sqlite:///var/lib/mautrix/bot.db"; - port = 29319; - as_token = "NwNtnSTUaIIxf8DIew1XMYyktrbckiMp8iwcXUGkHq28tYVc99A-IL2swBR7WFtl"; - hs_token = "QAuD0k9I3QCfEfhlnWbqBFGOTJz-fFdesnzZOovJxdfGVMDCkdFEb6Zvu5eGAIZi"; - }; - bridge = { - encryption = { - allow = true; - default = true; - }; - username_template = "facebook_{userid}"; - permissions = { - "*" = "relay"; - "broccoli.town" = "user"; - "@dung:broccoli.town" = "admin"; - }; - }; - }; - }; -} diff --git a/hosts/dingserver/caddy.nix b/hosts/dingserver/caddy.nix index 01836d9..f437d76 100644 --- a/hosts/dingserver/caddy.nix +++ b/hosts/dingserver/caddy.nix @@ -42,6 +42,7 @@ "danielpatterson.dev" = { extraConfig = '' root * /srv/site/danielpatterson.dev + encode zstd gzip file_server ''; }; diff --git a/hosts/dingserver/configuration.nix b/hosts/dingserver/configuration.nix index 93f1b22..8d54721 100644 --- a/hosts/dingserver/configuration.nix +++ b/hosts/dingserver/configuration.nix @@ -4,8 +4,9 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - ./synapse.nix ./caddy.nix + ./synapse.nix + ./syncthing.nix ]; # Use the GRUB 2 boot loader. @@ -26,12 +27,13 @@ users.users.daniel = { isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + extraGroups = [ "wheel" "syncthing" ]; # Enable ‘sudo’ for the user. }; environment.systemPackages = with pkgs; [ curl git + helix kitty lazygit wget diff --git a/hosts/dingserver/synapse.nix b/hosts/dingserver/synapse.nix index 17e880f..466e8f6 100644 --- a/hosts/dingserver/synapse.nix +++ b/hosts/dingserver/synapse.nix @@ -6,23 +6,24 @@ in { services.matrix-synapse = { enable = true; - server_name = "broccoli.town"; - database_type = "sqlite3"; - max_upload_size = "50M"; - listeners = [ - { - port = 8008; - bind_address = "::1"; - type = "http"; - tls = false; - x_forwarded = true; - resources = [ - { - names = [ "client" "federation" ]; - compress = false; - } - ]; - } - ]; + settings = { + server_name = "broccoli.town"; + database.name = "sqlite3"; + max_upload_size = "50M"; + listeners = [ + { + port = 8008; + type = "http"; + tls = false; + x_forwarded = true; + resources = [ + { + names = [ "client" "federation" ]; + compress = false; + } + ]; + } + ]; + }; }; } diff --git a/hosts/dingserver/syncthing.nix b/hosts/dingserver/syncthing.nix new file mode 100644 index 0000000..9248072 --- /dev/null +++ b/hosts/dingserver/syncthing.nix @@ -0,0 +1,6 @@ +{ config, pkgs, lib, ... }: +{ + services.syncthing = { + enable = true; + }; +}