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;