git.iko.soy/typeable/nixpkgs
on master help sign in
Revert "nginx: Verify that configuration is syntactically correct" (#17337)
commit356c2fe00dcadfb61f01d3962bb61f0210dfb957 authorRobin Gloster <mail@glob.in> dateThu 28 Jul 2016, 13:55 (10 years ago) parent62f2f72
1 file changed+3−12
nixos/modules/services/web-servers/nginx/default.nix+3−12
nixos/modules/services/web-servers/nginx/default.nix+3−12
@@ -5,7 +5,7 @@ with lib;
55let
66 cfg = config.services.nginx;
77 nginx = cfg.package;
8− configFileText = ''
8+ configFile = pkgs.writeText "nginx.conf" ''
99 user ${cfg.user} ${cfg.group};
1010 daemon off;
1111
@@ -19,17 +19,6 @@ let
1919 ''}
2020 ${cfg.appendConfig}
2121 '';
22− configFile = pkgs.runCommand "nginx.conf" {
23− text = configFileText;
24− passAsFile = ["text"];
25− preferLocalBuild = true;
26− allowSubstitutes = false;
27− } ''
28− mkdir -p "$(dirname "$out")"
29− mv "$textPath" "$out"
30− (${nginx}/bin/nginx -t -c "$out" -p ${cfg.stateDir} || true) 2>&1 | grep -q 'syntax is ok'
31− '';
32−
3322in
3423
3524{
@@ -102,6 +91,8 @@ in
10291 };
10392
10493 config = mkIf cfg.enable {
94+ # TODO: test user supplied config file pases syntax test
95+
10596 systemd.services.nginx = {
10697 description = "Nginx Web Server";
10798 after = [ "network.target" ];