Skip to content

Commit

Permalink
nixos/matrix-synapse: Add module parameter extraConfigFiles (#33276)
Browse files Browse the repository at this point in the history
This allows to configure additional configuration files for Synapse. This way
secrets can be kept in a secure place on the file system without a need to go
through the Nix store.
  • Loading branch information
johbo authored and joachifm committed Jan 7, 2018
1 parent 3d8e5fe commit a88b4d4
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion nixos/modules/services/misc/matrix-synapse.nix
Expand Up @@ -578,6 +578,18 @@ in {
Extra config options for matrix-synapse.
'';
};
extraConfigFiles = mkOption {
type = types.listOf types.path;
default = [];
description = ''
Extra config files to include.
The configuration files will be included based on the command line
argument --config-path. This allows to configure secrets without
having to go through the Nix store, e.g. based on deployment keys if
NixOPS is in use.
'';
};
logConfig = mkOption {
type = types.lines;
default = readFile ./matrix-synapse-log_config.yaml;
Expand Down Expand Up @@ -627,7 +639,11 @@ in {
Group = "matrix-synapse";
WorkingDirectory = cfg.dataDir;
PermissionsStartOnly = true;
ExecStart = "${cfg.package}/bin/homeserver --config-path ${configFile} --keys-directory ${cfg.dataDir}";
ExecStart = ''
${cfg.package}/bin/homeserver \
${ concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ configFile ] ++ cfg.extraConfigFiles) }
--keys-directory ${cfg.dataDir}
'';
Restart = "on-failure";
};
};
Expand Down

0 comments on commit a88b4d4

Please sign in to comment.