diff options
author | Martin Fischer <martin@push-f.com> | 2025-03-09 19:03:31 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2025-03-09 19:15:07 +0100 |
commit | de57db8d64eb4de42a49882642152aaf13b34cad (patch) | |
tree | 36bcb5a47395ff72c5a9e72365c708da0a0a7cb2 | |
parent | 509f45656171f9aa4fc3398c9a2a2022da11faf8 (diff) |
tente: configure separate nginx logs
-rw-r--r-- | nixos/helpers.nix | 5 | ||||
-rw-r--r-- | nixos/hosts/tente/git.nix | 2 | ||||
-rw-r--r-- | nixos/hosts/tente/matrix.nix | 2 | ||||
-rw-r--r-- | nixos/hosts/tente/web-personal.nix | 2 |
4 files changed, 11 insertions, 0 deletions
diff --git a/nixos/helpers.nix b/nixos/helpers.nix index 7880cc7..0588cd6 100644 --- a/nixos/helpers.nix +++ b/nixos/helpers.nix @@ -2,6 +2,11 @@ let nixpkgs = import <nixpkgs> {}; in { + mkNginxConfig = name: '' + access_log /var/log/nginx/${name}.access.log; + error_log /var/log/nginx/${name}.error.log; + ''; + joinWgNamespace = ns: cfg: nixpkgs.lib.attrsets.recursiveUpdate cfg { bindsTo = ["netns@${ns}.service"]; diff --git a/nixos/hosts/tente/git.nix b/nixos/hosts/tente/git.nix index 0e005c7..912abab 100644 --- a/nixos/hosts/tente/git.nix +++ b/nixos/hosts/tente/git.nix @@ -2,6 +2,7 @@ let cfg = config.git; + helpers = import <top/helpers.nix>; in { options.git = { @@ -30,6 +31,7 @@ in nginx.virtualHosts.${cfg.webUiDomain} = { enableACME = true; forceSSL = true; + extraConfig = helpers.mkNginxConfig cfg.webUiDomain; }; cgit.main = { diff --git a/nixos/hosts/tente/matrix.nix b/nixos/hosts/tente/matrix.nix index ab6931e..7e802c6 100644 --- a/nixos/hosts/tente/matrix.nix +++ b/nixos/hosts/tente/matrix.nix @@ -2,6 +2,7 @@ let cfg = config.matrix; + helpers = import <top/helpers.nix>; in { options.matrix = { @@ -46,6 +47,7 @@ in nginx.virtualHosts.${cfg.apiDomain} = { enableACME = true; forceSSL = true; + extraConfig = helpers.mkNginxConfig cfg.apiDomain; # TODO: add locations."/" with some message diff --git a/nixos/hosts/tente/web-personal.nix b/nixos/hosts/tente/web-personal.nix index 7c17063..4e86e9b 100644 --- a/nixos/hosts/tente/web-personal.nix +++ b/nixos/hosts/tente/web-personal.nix @@ -2,6 +2,7 @@ let cfg = config.web-personal; + helpers = import <top/helpers.nix>; in { options.web-personal = { @@ -27,6 +28,7 @@ in enableACME = true; forceSSL = true; root = "/srv/www/${cfg.domain}"; + extraConfig = helpers.mkNginxConfig cfg.domain; locations."= /.well-known/matrix/server".extraConfig = mkWellKnown { "m.server" = "${cfg.matrixApiDomain}:443"; |