nixfiles/packages/nf-actions-test/default.nix
2024-10-18 18:23:41 -04:00

22 lines
656 B
Nix

{
wrapShellScriptBin,
pkgs,
inputs
}: let
exports = ''
export NF_CONFIG_ROOT=''${NF_CONFIG_ROOT-${toString ../.}}
'';
exportsSystems = let
inherit (inputs.self) systems;
nixosSystems = set.filter (_: system: system.ci.enable) systems;
warnSystems = set.filter (_: system: system.ci.allowFailure) nixosSystems;
toSystems = systems: string.concatMapSep " " string.escapeShellArg (set.keys systems);
in ''
NF_NIX_SYSTEMS=(${toSystems nixosSystems})
NF_NIX_SYSTEMS_WARN=(${toSystems warnSystems})
'';
in pkgs.writeShellScriptBin "nf-actions-test" ''
${exports}
${exportsSystems}
source ${./actions-test.sh}
''