···161 configFile =
162 (if cfg.validateConfigFile then pkgs.writers.writeNginxConfig else pkgs.writeText) "nginx.conf"
163 ''
00164 pid /run/nginx/nginx.pid;
165 error_log ${cfg.logError};
166 daemon off;
···828829 If additional verbatim config in addition to other options is needed,
830 [](#opt-services.nginx.appendConfig) should be used instead.
000000000000831 '';
832 };
833
···161 configFile =
162 (if cfg.validateConfigFile then pkgs.writers.writeNginxConfig else pkgs.writeText) "nginx.conf"
163 ''
164+ ${cfg.prependConfig}
165+166 pid /run/nginx/nginx.pid;
167 error_log ${cfg.logError};
168 daemon off;
···830831 If additional verbatim config in addition to other options is needed,
832 [](#opt-services.nginx.appendConfig) should be used instead.
833+ '';
834+ };
835+836+ prependConfig = mkOption {
837+ type = types.lines;
838+ default = "";
839+ description = ''
840+ Configuration lines prepended to the generated Nginx
841+ configuration file. Can for example be used to load modules.
842+ {option}`prependConfig` can be specified more than once
843+ and its value will be concatenated (contrary to {option}`config`
844+ which can be set only once).
845 '';
846 };
847