diff --git a/api/src/bin/pistond.js b/api/src/bin/pistond.js index 1712c36..1478c0c 100755 --- a/api/src/bin/pistond.js +++ b/api/src/bin/pistond.js @@ -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 => { diff --git a/flake.nix b/flake.nix index d53fc00..1e7d940 100644 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,7 @@ "bash-only" = runtimeList ["bash"]; "none" = { }; }; + pistonRuntimePriorities = import ./runtimes/priorities; legacyPackages."${system}" = rec { nosocket = (import ./nosocket { inherit pkgs; }).package; diff --git a/runtimes/priorities/default.nix b/runtimes/priorities/default.nix index 128310a..38bd89e 100644 --- a/runtimes/priorities/default.nix +++ b/runtimes/priorities/default.nix @@ -1,7 +1,7 @@ [ "node-javascript" - "python2" "python3" + "python2" "bash" "clojure" "cobol-gnu-cobol"