nixos/nginx: add validateConfigFile option
Add an option to disable configuration file processing and validation.
This commit is contained in:
parent
fac6b8cf3a
commit
60c75135f8
@ -142,7 +142,11 @@ let
|
||||
default_type application/octet-stream;
|
||||
'';
|
||||
|
||||
configFile = pkgs.writers.writeNginxConfig "nginx.conf" ''
|
||||
configFile = (
|
||||
if cfg.validateConfigFile
|
||||
then pkgs.writers.writeNginxConfig
|
||||
else pkgs.writeText
|
||||
) "nginx.conf" ''
|
||||
pid /run/nginx/nginx.pid;
|
||||
error_log ${cfg.logError};
|
||||
daemon off;
|
||||
@ -1082,6 +1086,9 @@ in
|
||||
'';
|
||||
description = "Declarative vhost config";
|
||||
};
|
||||
validateConfigFile = lib.mkEnableOption ''
|
||||
Validate configuration with pkgs.writeNginxConfig.
|
||||
'' // { default = true; };
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user