From 46a389f743629e76a4b16def9e612cf75d1c4ee4 Mon Sep 17 00:00:00 2001 From: "Alexander V. Nikolaev" Date: Thu, 29 Aug 2024 20:29:16 +0300 Subject: [PATCH] Control logs in admin module Signed-off-by: Alexander V. Nikolaev --- nixos/modules/admin.nix | 5 +++++ nixos/tests/admin.nix | 1 + 2 files changed, 6 insertions(+) diff --git a/nixos/modules/admin.nix b/nixos/modules/admin.nix index f69a700..1ec42bc 100644 --- a/nixos/modules/admin.nix +++ b/nixos/modules/admin.nix @@ -23,6 +23,7 @@ in { options.givc.admin = { enable = mkEnableOption "Enable givc-admin module."; + debug = mkEnableOption "Enable givc-admin debug logging."; name = mkOption { description = "Host name (without domain)."; @@ -134,6 +135,10 @@ in "CA_CERT" = "${cfg.tls.caCertPath}"; "HOST_CERT" = "${cfg.tls.certPath}"; "HOST_KEY" = "${cfg.tls.keyPath}"; + } + // attrsets.optionalAttrs cfg.debug { + "RUST_BACKTRACE" = "1"; + "GIVC_LOG" = "debug"; }; }; networking.firewall.allowedTCPPorts = diff --git a/nixos/tests/admin.nix b/nixos/tests/admin.nix index 21e416c..b783882 100644 --- a/nixos/tests/admin.nix +++ b/nixos/tests/admin.nix @@ -44,6 +44,7 @@ in ]; givc.admin = { enable = true; + debug = true; name = "admin-vm"; addr = addrs.adminvm; port = "9001";