module.nix: add `enableDebug` option

This commit is contained in:
Oystein Kristoffer Tveit 2024-10-20 02:08:24 +02:00
parent 6bb8d28eff
commit c5f606f910
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
1 changed files with 5 additions and 0 deletions

View File

@ -14,6 +14,8 @@ in
enablePipewire = lib.mkEnableOption "pipewire" // { default = true; }; enablePipewire = lib.mkEnableOption "pipewire" // { default = true; };
enableDebug = lib.mkEnableOption "debug logs";
# TODO: create some better descriptions # TODO: create some better descriptions
settings = { settings = {
host = lib.mkOption { host = lib.mkOption {
@ -95,6 +97,9 @@ in
description = "greg-ng, an mpv based media player"; description = "greg-ng, an mpv based media player";
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ]; partOf = [ "graphical-session.target" ];
environment = {
RUST_LOG = lib.mkIf cfg.enableDebug "greg_ng=trace,mpvipc=trace";
};
serviceConfig = { serviceConfig = {
Type = "simple"; Type = "simple";
ExecStart = "${lib.getExe cfg.package} ${lib.cli.toGNUCommandLineShell { } cfg.settings}"; ExecStart = "${lib.getExe cfg.package} ${lib.cli.toGNUCommandLineShell { } cfg.settings}";