summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2016-07-28 13:55:06 +0200
committerRok Garbas <rok@garbas.si>2016-07-28 13:55:06 +0200
commit356c2fe00dcadfb61f01d3962bb61f0210dfb957 (patch)
tree66593c3b9546fb46171ffbfc56042c526d2f88a2 /nixos/modules
parent62f2f72e98453e0060c38d98930d2a3eabefeaae (diff)
downloadnixlib-356c2fe00dcadfb61f01d3962bb61f0210dfb957.tar
nixlib-356c2fe00dcadfb61f01d3962bb61f0210dfb957.tar.gz
nixlib-356c2fe00dcadfb61f01d3962bb61f0210dfb957.tar.bz2
nixlib-356c2fe00dcadfb61f01d3962bb61f0210dfb957.tar.lz
nixlib-356c2fe00dcadfb61f01d3962bb61f0210dfb957.tar.xz
nixlib-356c2fe00dcadfb61f01d3962bb61f0210dfb957.tar.zst
nixlib-356c2fe00dcadfb61f01d3962bb61f0210dfb957.zip
Revert "nginx: Verify that configuration is syntactically correct" (#17337)
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/web-servers/nginx/default.nix15
1 files changed, 3 insertions, 12 deletions
diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix
index bd936c0ce993..27a33f33ff93 100644
--- a/nixos/modules/services/web-servers/nginx/default.nix
+++ b/nixos/modules/services/web-servers/nginx/default.nix
@@ -5,7 +5,7 @@ with lib;
 let
   cfg = config.services.nginx;
   nginx = cfg.package;
-  configFileText = ''
+  configFile = pkgs.writeText "nginx.conf" ''
     user ${cfg.user} ${cfg.group};
     daemon off;
 
@@ -19,17 +19,6 @@ let
     ''}
     ${cfg.appendConfig}
   '';
-  configFile = pkgs.runCommand "nginx.conf" {
-    text = configFileText;
-    passAsFile = ["text"];
-    preferLocalBuild = true;
-    allowSubstitutes = false;
-  } ''
-    mkdir -p "$(dirname "$out")"
-    mv "$textPath" "$out"
-    (${nginx}/bin/nginx -t -c "$out" -p ${cfg.stateDir} || true) 2>&1 | grep -q 'syntax is ok'
-  '';
-
 in
 
 {
@@ -102,6 +91,8 @@ in
   };
 
   config = mkIf cfg.enable {
+    # TODO: test user supplied config file pases syntax test
+
     systemd.services.nginx = {
       description = "Nginx Web Server";
       after = [ "network.target" ];