nixos/redmine: allow user to override contents of additional_environment.rb

This commit is contained in:
Aaron Andersen 2020-08-25 11:33:25 -04:00
parent dee97b8b44
commit 6cf743e52d

View file

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (lib) mkDefault mkEnableOption mkIf mkOption mkRemovedOptionModule types; inherit (lib) mkBefore mkDefault mkEnableOption mkIf mkOption mkRemovedOptionModule types;
inherit (lib) concatStringsSep literalExample mapAttrsToList; inherit (lib) concatStringsSep literalExample mapAttrsToList;
inherit (lib) optional optionalAttrs optionalString; inherit (lib) optional optionalAttrs optionalString;
@ -21,13 +21,7 @@ let
''; '';
configurationYml = format.generate "configuration.yml" cfg.settings; configurationYml = format.generate "configuration.yml" cfg.settings;
additionalEnvironment = pkgs.writeText "additional_environment.rb" cfg.extraEnv;
additionalEnvironment = pkgs.writeText "additional_environment.rb" ''
config.logger = Logger.new("${cfg.stateDir}/log/production.log", 14, 1048576)
config.logger.level = Logger::INFO
${cfg.extraEnv}
'';
unpackTheme = unpack "theme"; unpackTheme = unpack "theme";
unpackPlugin = unpack "plugin"; unpackPlugin = unpack "plugin";
@ -252,6 +246,11 @@ in
}; };
}; };
services.redmine.extraEnv = mkBefore ''
config.logger = Logger.new("${cfg.stateDir}/log/production.log", 14, 1048576)
config.logger.level = Logger::INFO
'';
services.mysql = mkIf mysqlLocal { services.mysql = mkIf mysqlLocal {
enable = true; enable = true;
package = mkDefault pkgs.mariadb; package = mkDefault pkgs.mariadb;