Implement runtime priorities

This commit is contained in:
Omar Brikaa 2022-06-04 23:14:11 +02:00
parent 4470eb637f
commit b50af13787
3 changed files with 18 additions and 2 deletions

View File

@ -43,7 +43,22 @@ expressWs(app);
`nix eval --json ${config.flake_path}#pistonRuntimeSets.${config.runtime_set} --apply builtins.attrNames`
)
.toString();
const runtime_names = JSON.parse(runtimes_data);
const runtime_names_unordered = JSON.parse(runtimes_data);
const priorities_data = cp
.execSync(
`nix eval --json ${config.flake_path}#pistonRuntimePriorities`
)
.toString();
const priorities = JSON.parse(priorities_data).filter(runtime =>
runtime_names_unordered.includes(runtime)
);
const runtime_names = [
...priorities,
...runtime_names_unordered.filter(
runtime => !priorities.includes(runtime)
),
];
logger.info('Loading the runtimes from the flakes');
const runtimes = runtime_names.map(runtime_name => {

View File

@ -65,6 +65,7 @@
"bash-only" = runtimeList ["bash"];
"none" = { };
};
pistonRuntimePriorities = import ./runtimes/priorities;
legacyPackages."${system}" = rec {
nosocket = (import ./nosocket { inherit pkgs; }).package;

View File

@ -1,7 +1,7 @@
[
"node-javascript"
"python2"
"python3"
"python2"
"bash"
"clojure"
"cobol-gnu-cobol"