From a14f496db8bc460131cf13893630e0092e44cba8 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sat, 31 Aug 2024 20:03:11 +0200 Subject: [PATCH] fix(channel-scripts): fix RUST_LOG=info Signed-off-by: Raito Bezarius --- services/channel-scripts/default.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/services/channel-scripts/default.nix b/services/channel-scripts/default.nix index 15550ab..a12ad84 100644 --- a/services/channel-scripts/default.nix +++ b/services/channel-scripts/default.nix @@ -1,6 +1,7 @@ { lib, config, pkgs, ... }: +# FIXME(raito): I'm really really really not happy with this design of NixOS module, clean up all of this someday. let - inherit (lib) mkEnableOption mkOption types mkIf mapAttrsToList mkPackageOption concatStringsSep; + inherit (lib) mkEnableOption mkOption types mkIf mapAttrsToList mkPackageOption concatStringsSep mkMerge; cfg = config.bagel.nixpkgs.channel-scripts; toml = pkgs.formats.toml { }; configFile = toml.generate "forkos.toml" cfg.settings; @@ -135,15 +136,17 @@ in extraEnvironment = mkOption { type = types.listOf types.str; - default = [ - "RUST_LOG=info" - ]; }; }; config = mkIf cfg.enable { - bagel.nixpkgs.channel-scripts.extraEnvironment = mkIf cfg.otlp.enable [ - ''OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://tempo.forkos.org/v1/traces"'' + bagel.nixpkgs.channel-scripts.extraEnvironment = mkMerge [ + ([ + "RUST_LOG=info" + ]) + (mkIf cfg.otlp.enable [ + ''OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://tempo.forkos.org/v1/traces"'' + ]) ]; bagel.nixpkgs.channel-scripts.settings = { hydra_uri = cfg.hydraUrl;