diff options
Diffstat (limited to 'overlays/mautrix-signal-module.nix')
-rw-r--r-- | overlays/mautrix-signal-module.nix | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/overlays/mautrix-signal-module.nix b/overlays/mautrix-signal-module.nix index 22abbb5..27c1a36 100644 --- a/overlays/mautrix-signal-module.nix +++ b/overlays/mautrix-signal-module.nix @@ -16,6 +16,8 @@ in services.mautrix-signal = { enable = mkEnableOption (lib.mdDoc "Mautrix-Signal, a Matrix-Signal puppeting bridge."); + package = mkOption { type = types.package; default = pkgs.mautrix-signal; }; + settings = mkOption rec { apply = recursiveUpdate default; inherit (settingsFormat) type; @@ -155,15 +157,15 @@ in preStart = '' # generate the appservice's registration file if absent if [ ! -f '${registrationFile}' ]; then - ${pkgs.mautrix-signal}/bin/mautrix-signal \ + ${cfg.package}/bin/mautrix-signal \ --generate-registration \ - --base-config='${pkgs.mautrix-signal}/${pkgs.mautrix-signal.pythonModule.sitePackages}/mautrix_signal/example-config.yaml' \ + --base-config='${cfg.package}/${cfg.package.pythonModule.sitePackages}/mautrix_signal/example-config.yaml' \ --config='${settingsFile}' \ --registration='${registrationFile}' fi - '' + lib.optionalString (pkgs.mautrix-signal ? alembic) '' + '' + lib.optionalString (cfg.package ? alembic) '' # run automatic database init and migration scripts - ${pkgs.mautrix-signal.alembic}/bin/alembic -x config='${settingsFile}' upgrade head + ${cfg.package.alembic}/bin/alembic -x config='${settingsFile}' upgrade head ''; serviceConfig = { @@ -179,13 +181,13 @@ in DynamicUser = true; SupplementaryGroups = [ "signald" ]; PrivateTmp = true; - WorkingDirectory = pkgs.mautrix-signal; # necessary for the database migration scripts to be found + WorkingDirectory = cfg.package; # necessary for the database migration scripts to be found StateDirectory = baseNameOf dataDir; UMask = "0027"; EnvironmentFile = cfg.environmentFile; ExecStart = '' - ${pkgs.mautrix-signal}/bin/mautrix-signal \ + ${cfg.package}/bin/mautrix-signal \ --config='${settingsFile}' ''; }; |