diff options
author | Dominique Martinet @ jormungand <asmadeus@codewreck.org> | 2020-05-10 04:45:44 +0200 |
---|---|---|
committer | Dominique Martinet @ jormungand <asmadeus@codewreck.org> | 2020-05-10 04:56:11 +0200 |
commit | 28a0509e23e779a193aba861321888bda15bf320 (patch) | |
tree | 91b70acfa337baa4868b80e04576cd28a583f8b7 /machines/jormungand | |
parent | 9bccd3dd7822c4d5a5f8e2d8f536cae60f1283b7 (diff) |
jormungand: move matrix & postgresql off containers
No container left, ram usage went down quite a bit, but I
probably would have kept matrix in a container if I had
known how painful that thing was to setup...
Diffstat (limited to 'machines/jormungand')
-rw-r--r-- | machines/jormungand/configuration.nix | 2 | ||||
-rw-r--r-- | machines/jormungand/containers.nix | 53 | ||||
-rw-r--r-- | machines/jormungand/matrix.nix | 8 |
3 files changed, 9 insertions, 54 deletions
diff --git a/machines/jormungand/configuration.nix b/machines/jormungand/configuration.nix index 32536cf..5169cf8 100644 --- a/machines/jormungand/configuration.nix +++ b/machines/jormungand/configuration.nix @@ -11,7 +11,7 @@ ./mpd.nix ../../modules/ashuffle.nix ../../modules/vaderetro.nix - ./containers.nix + ./matrix.nix ]; boot.loader.grub.enable = true; diff --git a/machines/jormungand/containers.nix b/machines/jormungand/containers.nix deleted file mode 100644 index 1a03a05..0000000 --- a/machines/jormungand/containers.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ config, lib, pkgs, ... }: - -let targetConfig = { - # minimal.nix a bit more explicit to speed things up - documentation.doc.enable = false; - documentation.enable = false; - documentation.info.enable = false; - documentation.man.enable = false; - documentation.nixos.enable = false; - environment.noXlibs = true; - i18n.supportedLocales = [ "en_US.UTF-8/UTF-8" ]; - - # prevent nixpkgs to get evaluated multiple times - # workaround for https://github.com/NixOS/nixpkgs/issues/65690 - # also allows to use overlay packages within containers! - nixpkgs.pkgs = lib.mkForce pkgs; - - # site specifics - environment.systemPackages = with pkgs; [ kitty.terminfo ]; - time.timeZone = "Europe/Paris"; -}; in -{ - containers.matrix = { - autoStart = true; - timeoutStartSec = "10m"; - config = { config, pkgs, ... }: targetConfig // { - services.postgresql.enable = true; - services.postgresql.initialScript = pkgs.writeText "synapse-init.sql" '' - CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse'; - CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse" - TEMPLATE template0 - LC_COLLATE = "C" - LC_CTYPE = "C"; - ''; - services.matrix-synapse = { - enable = true; - server_name = "codewreck.org"; - # registration_shared_secret = ""; - listeners = [{ - port = 8008; - bind_address = "::1"; - type = "http"; - tls = false; - x_forwarded = true; - resources = [{ - names = [ "client" "federation" ]; - compress = false; - }]; - }]; - }; - }; - }; -} diff --git a/machines/jormungand/matrix.nix b/machines/jormungand/matrix.nix new file mode 100644 index 0000000..61c6e42 --- /dev/null +++ b/machines/jormungand/matrix.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ + imports = [ ../../modules/matrix.nix ]; + + services.matrix-synapse.server_name = "codewreck.org"; + # services.matrix-synapse.registration_shared_secret = ""; +} |