From c5f606f910163cbe7db544d3bef50f7e3795cd78 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 20 Oct 2024 02:08:24 +0200 Subject: [PATCH] module.nix: add `enableDebug` option --- module.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module.nix b/module.nix index 3e11613..009f265 100644 --- a/module.nix +++ b/module.nix @@ -14,6 +14,8 @@ in enablePipewire = lib.mkEnableOption "pipewire" // { default = true; }; + enableDebug = lib.mkEnableOption "debug logs"; + # TODO: create some better descriptions settings = { host = lib.mkOption { @@ -95,6 +97,9 @@ in description = "greg-ng, an mpv based media player"; wantedBy = [ "graphical-session.target" ]; partOf = [ "graphical-session.target" ]; + environment = { + RUST_LOG = lib.mkIf cfg.enableDebug "greg_ng=trace,mpvipc=trace"; + }; serviceConfig = { Type = "simple"; ExecStart = "${lib.getExe cfg.package} ${lib.cli.toGNUCommandLineShell { } cfg.settings}";