Merge pull request #310348 from ehmry/nginx-validateConfigFile
nixos/nginx: add validateConfigFile option
This commit is contained in:
commit
378c5c67ed
@ -142,7 +142,11 @@ let
|
|||||||
default_type application/octet-stream;
|
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;
|
pid /run/nginx/nginx.pid;
|
||||||
error_log ${cfg.logError};
|
error_log ${cfg.logError};
|
||||||
daemon off;
|
daemon off;
|
||||||
@ -1082,6 +1086,9 @@ in
|
|||||||
'';
|
'';
|
||||||
description = "Declarative vhost config";
|
description = "Declarative vhost config";
|
||||||
};
|
};
|
||||||
|
validateConfigFile = lib.mkEnableOption ''
|
||||||
|
Validate configuration with pkgs.writeNginxConfig.
|
||||||
|
'' // { default = true; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user