From 94c12be98aaa223cd9225a5f38c49e2daeaf3d11 Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Tue, 15 Nov 2022 11:33:22 -0800 Subject: [PATCH 1/2] fix: nginx log path error --- modules/services/nginx.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/services/nginx.nix b/modules/services/nginx.nix index 8a1814a..75db191 100644 --- a/modules/services/nginx.nix +++ b/modules/services/nginx.nix @@ -77,11 +77,13 @@ in install -o nginx -g nginx -m 0440 /dev/null ${runtimeConfig} envsubst < ${config} > ${runtimeConfig} + mkdir -p /var/log/nginx HOME=~nginx ${cfg.package}/bin/nginx \ -c ${runtimeConfig} '' else '' + mkdir -p /var/log/nginx HOME=~nginx ${cfg.package}/bin/nginx \ -c ${config} ''); From fa4751caa69729485addd7e934a6b83f60039a62 Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Tue, 15 Nov 2022 15:25:49 -0800 Subject: [PATCH 2/2] feat: add a basic configuration to bake into nginx --- modules/services/nginx.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/services/nginx.nix b/modules/services/nginx.nix index 75db191..8517c0a 100644 --- a/modules/services/nginx.nix +++ b/modules/services/nginx.nix @@ -58,7 +58,10 @@ in { init.services.nginx = let - config = pkgs.writeText "nginx.cfg" (toNginx cfg.configuration); + config = pkgs.writeText "nginx.cfg" (toNginx ([{ + daemon = "off"; + error_log = ["/dev/stderr" "info"]; + }] ++ (if builtins.isList cfg.configuration then cfg.configuration else [ cfg.configuration ]))); in { ensureSomething.create."cache" = { @@ -77,13 +80,11 @@ in install -o nginx -g nginx -m 0440 /dev/null ${runtimeConfig} envsubst < ${config} > ${runtimeConfig} - mkdir -p /var/log/nginx HOME=~nginx ${cfg.package}/bin/nginx \ -c ${runtimeConfig} '' else '' - mkdir -p /var/log/nginx HOME=~nginx ${cfg.package}/bin/nginx \ -c ${config} '');