Skip to content

Commit

Permalink
feat: use scenario package name from Cargo.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
cdunster committed Oct 29, 2024
1 parent dcc46ee commit dd6b6b9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions nix/modules/scenarios.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit dd6b6b9

Please sign in to comment.