nixos/mxisd: umask to avoid accidental world-readability

This commit is contained in:
Maximilian Bosch 2022-07-20 20:15:53 +02:00
parent 81add6600c
commit 590e60d124
No known key found for this signature in database
GPG Key ID: 9A6EEA275CA5BE0A

View File

@ -130,6 +130,7 @@ in {
EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
ExecStart = "${cfg.package}/bin/${executable} -c ${cfg.dataDir}/mxisd-config.yaml";
ExecStartPre = "${pkgs.writeShellScript "mxisd-substitute-secrets" ''
umask 0077
${pkgs.envsubst}/bin/envsubst -o ${cfg.dataDir}/mxisd-config.yaml \
-i ${configFile}
''}";