nixos/matrix-synapse: Add module parameter extraConfigFiles (#33276)
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.
This commit is contained in:
parent
3d8e5fe74c
commit
a88b4d4db1
@ -578,6 +578,18 @@ in {
|
|||||||
Extra config options for matrix-synapse.
|
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 {
|
logConfig = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = readFile ./matrix-synapse-log_config.yaml;
|
default = readFile ./matrix-synapse-log_config.yaml;
|
||||||
@ -627,7 +639,11 @@ in {
|
|||||||
Group = "matrix-synapse";
|
Group = "matrix-synapse";
|
||||||
WorkingDirectory = cfg.dataDir;
|
WorkingDirectory = cfg.dataDir;
|
||||||
PermissionsStartOnly = true;
|
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";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user