Skip to content

Commit a88b4d4

Browse files
johbojoachifm
authored andcommittedJan 7, 2018
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.
1 parent 3d8e5fe commit a88b4d4

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed
 

‎nixos/modules/services/misc/matrix-synapse.nix

+17-1
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,18 @@ in {
578578
Extra config options for matrix-synapse.
579579
'';
580580
};
581+
extraConfigFiles = mkOption {
582+
type = types.listOf types.path;
583+
default = [];
584+
description = ''
585+
Extra config files to include.
586+
587+
The configuration files will be included based on the command line
588+
argument --config-path. This allows to configure secrets without
589+
having to go through the Nix store, e.g. based on deployment keys if
590+
NixOPS is in use.
591+
'';
592+
};
581593
logConfig = mkOption {
582594
type = types.lines;
583595
default = readFile ./matrix-synapse-log_config.yaml;
@@ -627,7 +639,11 @@ in {
627639
Group = "matrix-synapse";
628640
WorkingDirectory = cfg.dataDir;
629641
PermissionsStartOnly = true;
630-
ExecStart = "${cfg.package}/bin/homeserver --config-path ${configFile} --keys-directory ${cfg.dataDir}";
642+
ExecStart = ''
643+
${cfg.package}/bin/homeserver \
644+
${ concatMapStringsSep "\n " (x: "--config-path ${x} \\") ([ configFile ] ++ cfg.extraConfigFiles) }
645+
--keys-directory ${cfg.dataDir}
646+
'';
631647
Restart = "on-failure";
632648
};
633649
};

0 commit comments

Comments
 (0)
Please sign in to comment.