nixfiles/wrappers/exports.nix
2025-07-13 07:09:45 -07:00

17 lines
675 B
Nix

{inputs, ...}: let
inherit (inputs.std.lib.Std.compat) string set;
inherit (inputs.self) systems;
enabledNixosSystems = set.filter (_: system: system.config.ci.enable && system.config.type == "NixOS") systems;
in {
exports = ''
export NF_CONFIG_ROOT=''${NF_CONFIG_ROOT-${toString ../.}}
export CI_CONFIG_ROOT=$NF_CONFIG_ROOT
'';
exportsSystems = let
warnSystems = set.filter (_: system: system.config.ci.allowFailure) enabledNixosSystems;
toSystems = systems: string.concatMapSep " " string.escapeShellArg (set.keys systems);
in ''
NF_NIX_SYSTEMS=(${toSystems enabledNixosSystems})
NF_NIX_SYSTEMS_WARN=(${toSystems warnSystems})
'';
}