diff --git a/nix/modules/scenarios.nix b/nix/modules/scenarios.nix index 32bc7ae..ec150d0 100644 --- a/nix/modules/scenarios.nix +++ b/nix/modules/scenarios.nix @@ -4,15 +4,20 @@ let scenariosDir = ../../scenarios; scenario_names = builtins.filter (name: !(lib.strings.hasInfix "." name)) (builtins.attrNames (builtins.readDir scenariosDir)); + getScenarioName = path: (builtins.fromTOML (builtins.readFile "${path}/Cargo.toml")).package.name; scenarios = map - (name: { - inherit name; - value = config.scenarioHelper.mkScenario { + (dirName: + let + path = "${scenariosDir}/${dirName}"; + name = getScenarioName path; + in + { inherit name; - path = "${scenariosDir}/${name}"; - }; - }) + value = config.scenarioHelper.mkScenario { + inherit name path; + }; + }) scenario_names; in {