mirror of
https://github.com/dali99/nixos-matrix-modules.git
synced 2026-01-21 14:58:21 +01:00
Compare commits
5 Commits
out-of-you
...
v0.5.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 046194cdad | |||
| 3f92b5f197 | |||
| a24a5e5da4 | |||
| e098146571 | |||
| 1e370b9622 |
@@ -2,9 +2,9 @@
|
||||
|
||||
This is a best effort document descibing neccecary changes you might have to do when updating
|
||||
|
||||
## 0.5.0 UNRELEASED
|
||||
|
||||
The module has been renamed from `synapse` to `default`
|
||||
## 0.5.0
|
||||
|
||||
* The module has been renamed from `synapse` to `default`
|
||||
* The synapse module now expects a wrapper-style package. This means the module is now incompatible with nixpkgs < 23.11.
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ services.matrix-synapse-next = {
|
||||
enableSlidingSync = true;
|
||||
};
|
||||
|
||||
matrix-synapse.sliding-sync.environmentFile = "/some/file/containing/SYNCV3_SECRET=<some secret>";
|
||||
services.matrix-synapse.sliding-sync.environmentFile = "/some/file/containing/SYNCV3_SECRET=<some secret>";
|
||||
|
||||
```
|
||||
|
||||
|
||||
18
flake.lock
generated
18
flake.lock
generated
@@ -1,23 +1,23 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1697239051,
|
||||
"narHash": "sha256-TvKERJH5h470GWyTOgEKzxdBz9tjQdSGlAFDbHhAI7g=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e0c8b6f719e911224906f3c059208a7f0e3441c7",
|
||||
"lastModified": 1673743903,
|
||||
"narHash": "sha256-sloY6KYyVOozJ1CkbgJPpZ99TKIjIvM+04V48C04sMQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "7555e2dfcbac1533f047021f1744ac8871150f9f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
13
flake.nix
13
flake.nix
@@ -2,20 +2,13 @@
|
||||
description = "NixOS modules for matrix related services";
|
||||
|
||||
inputs = {
|
||||
# nixpkgs-lib.url = github:nix-community/nixpkgs.lib;
|
||||
nixpkgs.url = github:nixos/nixpkgs;
|
||||
nixpkgs-lib.url = github:nix-community/nixpkgs.lib;
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
systems = [ "x86_64-linux"];
|
||||
in {
|
||||
outputs = { self, nixpkgs-lib }: {
|
||||
nixosModules = {
|
||||
default = import ./module.nix;
|
||||
};
|
||||
lib = import ./lib.nix { lib = nixpkgs.lib; };
|
||||
packages = nixpkgs.lib.genAttrs systems (system: {
|
||||
out-of-your-element = nixpkgs.legacyPackages.${system}.callPackage ./pkgs/out-of-your-element {};
|
||||
});
|
||||
lib = import ./lib.nix { lib = nixpkgs-lib.lib; };
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
{ lib
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "matrix-sliding-sync";
|
||||
version = "0.99.10";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "matrix-org";
|
||||
repo = "sliding-sync";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-TjChelGVicA59q6iIIDTI7nSj8KtjpA4bfZqsfoiOQg=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-E3nCcw6eTKKcL55ls6n5pYlRFffsefsN0G1Hwd49uh8=";
|
||||
|
||||
subPackages = [ "cmd/syncv3" ];
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X main.GitCommit=${src.rev}"
|
||||
];
|
||||
|
||||
# requires a running matrix-synapse
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A sliding sync implementation of MSC3575 for matrix";
|
||||
homepage = "https://github.com/matrix-org/sliding-sync";
|
||||
license = with licenses; [ asl20 ];
|
||||
maintainers = with maintainers; [ emilylange ];
|
||||
mainProgram = "syncv3";
|
||||
};
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
{ lib
|
||||
, buildNpmPackage
|
||||
, fetchFromGitea
|
||||
, git
|
||||
}:
|
||||
|
||||
buildNpmPackage rec {
|
||||
pname = "out-of-your-element";
|
||||
version = "1.2";
|
||||
|
||||
src = fetchFromGitea {
|
||||
domain = "gitdab.com";
|
||||
owner = "cadence";
|
||||
repo = "out-of-your-element";
|
||||
rev = "v1.2";
|
||||
hash = "sha256-rlp6Eens5gV0dwLpICjKaVhxNXXeb/S7l628eXYvZaY=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-ComQ8ua7k8zg0Dzih+MVgjnySpSlLJmLqnwxADCUv7M=";
|
||||
|
||||
dontNpmBuild = true;
|
||||
|
||||
makeCacheWritable = true;
|
||||
npmFlags = [ "--loglevel=verbose" ]; #"--legacy-peer-deps" ];
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ in
|
||||
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.callPackage ../pkgs/matrix-sliding-sync { };
|
||||
default = pkgs.matrix-sliding-sync;
|
||||
description = "What package to use for the sliding-sync proxy.";
|
||||
};
|
||||
|
||||
|
||||
@@ -11,8 +11,22 @@ let
|
||||
|
||||
format = pkgs.formats.yaml {};
|
||||
matrix-synapse-common-config = format.generate "matrix-synapse-common-config.yaml" cfg.settings;
|
||||
pluginsEnv = cfg.package.python.buildEnv.override {
|
||||
extraLibs = cfg.plugins;
|
||||
|
||||
# TODO: Align better with the upstream module
|
||||
wrapped = cfg.package.override {
|
||||
inherit (cfg) plugins;
|
||||
extras = [
|
||||
"postgres"
|
||||
"saml2"
|
||||
"oidc"
|
||||
"systemd"
|
||||
"url-preview"
|
||||
"sentry"
|
||||
"jwt"
|
||||
"redis"
|
||||
"cache-memory"
|
||||
"user-search"
|
||||
];
|
||||
};
|
||||
|
||||
inherit (lib)
|
||||
@@ -33,7 +47,7 @@ in
|
||||
imports = [
|
||||
./nginx.nix
|
||||
(import ./workers.nix {
|
||||
inherit matrix-lib throw' format matrix-synapse-common-config pluginsEnv;
|
||||
inherit matrix-lib throw' format matrix-synapse-common-config wrapped;
|
||||
})
|
||||
];
|
||||
|
||||
@@ -376,9 +390,6 @@ in
|
||||
};
|
||||
in "${cfg.package}/bin/synapse_homeserver ${flags}";
|
||||
|
||||
environment.PYTHONPATH =
|
||||
lib.makeSearchPathOutput "lib" cfg.package.python.sitePackages [ pluginsEnv ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "notify";
|
||||
User = "matrix-synapse";
|
||||
@@ -390,7 +401,7 @@ in
|
||||
config-path = [ matrix-synapse-common-config ] ++ cfg.extraConfigFiles;
|
||||
keys-directory = cfg.dataDir;
|
||||
};
|
||||
in "${cfg.package}/bin/synapse_homeserver ${flags}";
|
||||
in "${wrapped}/bin/synapse_homeserver ${flags}";
|
||||
ExecReload = "${pkgs.utillinux}/bin/kill -HUP $MAINPID";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ matrix-synapse-common-config,
|
||||
matrix-lib,
|
||||
pluginsEnv,
|
||||
wrapped,
|
||||
throw',
|
||||
format
|
||||
}:
|
||||
@@ -333,11 +333,6 @@ in {
|
||||
wantedBy = [ "matrix-synapse.target" ];
|
||||
after = [ "matrix-synapse.service" ];
|
||||
requires = [ "matrix-synapse.service" ];
|
||||
environment = {
|
||||
PYTHONPATH = lib.makeSearchPathOutput "lib" cfg.package.python.sitePackages [
|
||||
pluginsEnv
|
||||
];
|
||||
};
|
||||
serviceConfig = {
|
||||
Type = "notify";
|
||||
User = "matrix-synapse";
|
||||
@@ -355,7 +350,7 @@ in {
|
||||
config-path = [ matrix-synapse-common-config (workerConfig worker) ] ++ cfg.extraConfigFiles;
|
||||
keys-directory = cfg.dataDir;
|
||||
};
|
||||
in "${cfg.package}/bin/synapse_worker ${flags}";
|
||||
in "${wrapped}/bin/synapse_worker ${flags}";
|
||||
};
|
||||
};
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user