From 7ae8526771e8efea95c76e20ccfe3a5ea7e0291e Mon Sep 17 00:00:00 2001 From: Colin Date: Sat, 28 May 2022 12:35:43 -0700 Subject: [PATCH] update nixos-21.11 -> nixos-22.05 --- flake.lock | 8 ++-- flake.nix | 2 +- machines/uninsane/services/matrix.nix | 67 +++++++++++++++++---------- 3 files changed, 48 insertions(+), 29 deletions(-) diff --git a/flake.lock b/flake.lock index ca3d14b7..18abe788 100644 --- a/flake.lock +++ b/flake.lock @@ -39,16 +39,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1653229824, - "narHash": "sha256-klSCYMpR4TqWYoTD/xZ2qM9UIPRFC6pK+S/kJuVLbFw=", + "lastModified": 1653504306, + "narHash": "sha256-bqjEskV+/tqOQqSEaCu4e6uWZ0F7ekBiMR16xpn4V0k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "06db2e2197401b74fcf82d4e84be15b0b5851c7b", + "rev": "6efc186e6079ff3f328a2497ff3d36741ac60f6e", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-21.11", + "ref": "nixos-22.05", "type": "indirect" } }, diff --git a/flake.nix b/flake.nix index 6f57e148..b21cd6a4 100644 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,7 @@ { inputs = { - nixpkgs.url = "nixpkgs/nixos-21.11"; + nixpkgs.url = "nixpkgs/nixos-22.05"; pkgs-unstable.url = "nixpkgs/nixos-unstable"; pkgs-gitea.url = "nixpkgs/c777cdf5c564015d5f63b09cc93bef4178b19b01"; # pkgs-telegram.url = "nixpkgs/33775ec9a2173a08e46edf9f46c9febadbf743e8";# 2022/04/18; telegram 3.7.3. fails: nix log /nix/store/y5kv47hnv55qknb6cnmpcyraicay79fx-telegram-desktop-3.7.3.drv: g++: fatal error: cannot execute '/nix/store/njk5sbd21305bhr7gwibxbbvgbx5lxvn-gcc-9.3.0/libexec/gcc/aarch64-unknown-linux-gnu/9.3.0/cc1plus': execv: No such file or directory diff --git a/machines/uninsane/services/matrix.nix b/machines/uninsane/services/matrix.nix index 6697011a..71973a35 100644 --- a/machines/uninsane/services/matrix.nix +++ b/machines/uninsane/services/matrix.nix @@ -4,19 +4,19 @@ { services.matrix-synapse.enable = true; - services.matrix-synapse.server_name = "uninsane.org"; + services.matrix-synapse.settings.server_name = "uninsane.org"; # services.matrix-synapse.enable_registration_captcha = true; # services.matrix-synapse.enable_registration_without_verification = true; - services.matrix-synapse.enable_registration = true; + services.matrix-synapse.settings.enable_registration = true; # services.matrix-synapse.registration_shared_secret = ""; # default for listeners is port = 8448, tls = true, x_forwarded = false. # we change this because the server is situated behind nginx. - services.matrix-synapse.listeners = [ + services.matrix-synapse.settings.listeners = [ { port = 8008; - bind_address = "127.0.0.1"; + bind_addresses = [ "127.0.0.1" ]; type = "http"; tls = false; x_forwarded = true; @@ -34,26 +34,45 @@ # admin_contact: "admin.matrix@uninsane.org" # ''; - services.matrix-synapse.extraConfig = '' - admin_contact: "admin.matrix@uninsane.org" - registrations_require_3pid: - - email - email: - smtp_host: "mx.uninsane.org" - smtp_port: 587 - smtp_user: "matrix-synapse" - smtp_pass: "${secrets.matrix-synapse.smtp_pass}" - require_transport_security: true - enable_tls: true - notif_from: "%(app)s " - app_name: "Uninsane Matrix" - enable_notifs: true - validation_token_lifetime: 96h - invite_client_location: "https://web.matrix.uninsane.org" - subjects: - email_validation: "[%(server_name)s] Validate your email" - ''; - services.matrix-synapse.app_service_config_files = [ + services.matrix-synapse.settings.admin_contact = "admin.matrix@uninsane.org"; + services.matrix-synapse.settings.registrations_require_3pid = [ "email" ]; + services.matrix-synapse.settings.email = { + smtp_host = "mx.uninsane.org"; + smtp_port = 587; + smtp_user = "matrix-synapse"; + smtp_pass = secrets.matrix-synapse.smtp_pass; + require_transport_security = true; + enable_tls = true; + notif_from = "%(app)s "; + app_name = "Uninsane Matrix"; + enable_notifs = true; + validation_token_lifetime = "96h"; + invite_client_location = "https://web.matrix.uninsane.org"; + subjects = { + email_validation = "[%(server_name)s] Validate your email"; + }; + }; + + # services.matrix-synapse.extraConfigFiles = [builtins.toFile "matrix-synapse-extra-config" '' + # admin_contact: "admin.matrix@uninsane.org" + # registrations_require_3pid: + # - email + # email: + # smtp_host: "mx.uninsane.org" + # smtp_port: 587 + # smtp_user: "matrix-synapse" + # smtp_pass: "${secrets.matrix-synapse.smtp_pass}" + # require_transport_security: true + # enable_tls: true + # notif_from: "%(app)s " + # app_name: "Uninsane Matrix" + # enable_notifs: true + # validation_token_lifetime: 96h + # invite_client_location: "https://web.matrix.uninsane.org" + # subjects: + # email_validation: "[%(server_name)s] Validate your email" + # '']; + services.matrix-synapse.settings.app_service_config_files = [ "/var/lib/matrix-appservice-irc/registration.yml" # auto-created by irc appservice ];