Compare commits
No commits in common. "4decbc5f3c56605a52a8d9f0cc2e41886c10ffb1" and "7c92880612fb8bd066c8ec23ddc15e32cc76044d" have entirely different histories.
4decbc5f3c
...
7c92880612
6
flake.lock
generated
6
flake.lock
generated
@ -257,11 +257,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1688894907,
|
"lastModified": 1688859638,
|
||||||
"narHash": "sha256-U7hEDDhzAhLp6T+DEUbfwAsL+BtqFFGn+S1pa/0XrZY=",
|
"narHash": "sha256-GyRhX8GlTQqDWx43uBFEYEQ/WKEqDwjzABHxUCatAno=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "4ddf98349c793377c76806ebfbdfb2b96dd4ef5d",
|
"rev": "d485da9d0034a72ceb9679c2ab0156c073f66b82",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
|
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
|
||||||
boot.loader.grub.enable = false;
|
boot.loader.grub.enable = false;
|
||||||
# Enables the generation of /boot/extlinux/extlinux.conf
|
# Enables the generation of /boot/extlinux/extlinux.conf
|
||||||
boot.loader.generic-extlinux-compatible.enable = true;
|
boot.loader.generic-extlinux-compatible.enable = false;
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_rpi4;
|
boot.kernelPackages = pkgs.linuxPackages_rpi4;
|
||||||
|
|
||||||
# networking.hostName = "nixos"; # Define your hostname.
|
# networking.hostName = "nixos"; # Define your hostname.
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
|
||||||
../../services/matrix-sliding-sync.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
matrix-synapse-tools.synadm
|
matrix-synapse-tools.synadm
|
||||||
];
|
];
|
||||||
@ -21,7 +17,7 @@
|
|||||||
LC_CTYPE = "C";
|
LC_CTYPE = "C";
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
postgresqlBackup.databases = [ "matrix" "matrix-syncv3" ];
|
postgresqlBackup.databases = [ "matrix" ];
|
||||||
|
|
||||||
matrix-synapse = {
|
matrix-synapse = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -52,8 +48,6 @@
|
|||||||
config.sops.secrets.matrix-registration-secret.path
|
config.sops.secrets.matrix-registration-secret.path
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
matrix-syncv3.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sops.secrets.matrix-registration-secret = {
|
sops.secrets.matrix-registration-secret = {
|
||||||
|
@ -10,12 +10,6 @@
|
|||||||
locations."/" = { proxyPass = "http://100.111.208.75:8008"; };
|
locations."/" = { proxyPass = "http://100.111.208.75:8008"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
"syncv3.walkah.chat" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = { proxyPass = "http://100.111.208.75:8088"; };
|
|
||||||
};
|
|
||||||
|
|
||||||
"walkah.chat" = {
|
"walkah.chat" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
@ -31,7 +25,6 @@
|
|||||||
let
|
let
|
||||||
client = {
|
client = {
|
||||||
"m.homeserver" = { "base_url" = "https://matrix.walkah.chat"; };
|
"m.homeserver" = { "base_url" = "https://matrix.walkah.chat"; };
|
||||||
"org.matrix.msc3575.proxy" = { "url" = "https://syncv3.walkah.chat"; };
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
''
|
''
|
||||||
|
@ -1,63 +0,0 @@
|
|||||||
{ config, lib, pkgs, options, ... }:
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.services.matrix-syncv3;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
services.matrix-syncv3 = {
|
|
||||||
enable = mkEnableOption "SyncV3 for matrix";
|
|
||||||
package = mkPackageOption pkgs "matrix-sliding-sync" { };
|
|
||||||
|
|
||||||
port = mkOption {
|
|
||||||
type = types.int;
|
|
||||||
default = 8088;
|
|
||||||
description = ''
|
|
||||||
The port to listen on.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
environmentFile = mkOption {
|
|
||||||
type = types.nullOr types.path;
|
|
||||||
default = null;
|
|
||||||
description = ''
|
|
||||||
Must contain the `SYNCV3_SECRET` environment variable.
|
|
||||||
Generated with ``openssl rand -hex 32``.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
services = {
|
|
||||||
postgresql = {
|
|
||||||
ensureDatabases = [ "matrix-syncv3" ];
|
|
||||||
ensureUsers = [{
|
|
||||||
name = "matrix-syncv3";
|
|
||||||
ensurePermissions."DATABASE \"matrix-syncv3\"" = "ALL PRIVILEGES";
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.matrix-syncv3 = {
|
|
||||||
after = [ "matrix-synapse.service" "postgresql.service" ];
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
serviceConfig = {
|
|
||||||
DynamicUser = true;
|
|
||||||
StateDirectory = "matrix-syncv3";
|
|
||||||
WorkingDirectory = "/var/lib/matrix-syncv3";
|
|
||||||
Environment = [
|
|
||||||
"SYNCV3_SERVER=https://matrix.walkah.chat"
|
|
||||||
"SYNCV3_DB=postgresql:///matrix-syncv3?host=/run/postgresql"
|
|
||||||
"SYNCV3_BINDADDR=0.0.0.0:${toString cfg.port}"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
script = ''
|
|
||||||
path=/var/lib/matrix-syncv3/secret
|
|
||||||
[ -f $path ] || ${pkgs.openssl}/bin/openssl rand -hex 32 > $path
|
|
||||||
export SYNCV3_SECRET=$(cat $path)
|
|
||||||
exec ${cfg.package}/bin/syncv3
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user