HASH 10fdb3a304a3
DATE 2025-08-06
SUBJECT nix: move simulation scripts to simulation top-level arg
FILES 9 CHANGED HASH 10fdb3a304a3
DATE 2025-08-06
SUBJECT nix: move simulation scripts to
simulation top-level arg
FILES 9 CHANGED ┌─ nix/apps/default.nix ──────────────────────────────────────────────────── [ COPY ] ─┐
│ diff --git a/nix/apps/default.nix b/nix/apps/default.nix │
│ index a9c94d3..4d6703d 100644 │
│ --- a/nix/apps/default.nix │
│ +++ b/nix/apps/default.nix │
│ @@ -7,18 +7,45 @@ │
│ inputs, │
│ trinket, │
│ api, │
│ + simulation, │
│ ... │
│ }: { │
│ perSystem = {pkgs, ...}: let │
│ inherit (pkgs) writers python3Packages; │
│ - simulation = import ./simulation {inherit lib classes encounter buffs debuffs │
│ inputs trinket pkgs;}; │
│ getDB = pkgs.callPackage ./getDB.nix {inherit inputs;}; │
│ getCMLeaders = import ./challenge-mode-leaderboard.nix {inherit api writers p │
│ ython3Packages;}; │
│ parseCMs = import ./challenge-mode-parser.nix {inherit api writers python3Pac │
│ kages;}; │
│ + # Convert simulation data to apps │
│ + simulationApps = │
│ + lib.mapAttrs (name: sim: { │
│ + type = "app"; │
│ + program = "${sim.script}/bin/${sim.metadata.output}-aggregator"; │
│ + }) │
│ + (simulation.generateMassSimulations pkgs); │
│ + │
│ + raceComparisonApps = │
│ + lib.mapAttrs (name: raceComp: { │
│ + type = "app"; │
│ + program = "${raceComp.script}/bin/${raceComp.metadata.output}-aggregator" │
│ ; │
│ + }) │
│ + (simulation.generateRaceComparisons pkgs); │
│ + │
│ + trinketComparisonApps = │
│ + lib.mapAttrs (name: trinketComp: { │
│ + type = "app"; │
│ + program = "${trinketComp.script}/bin/${trinketComp.metadata.output}-aggre │
│ gator"; │
│ + }) │
│ + (simulation.generateTrinketComparisons pkgs); │
│ in { │
│ apps = │
│ - simulation │
│ + simulationApps │
│ + // raceComparisonApps │
│ + // trinketComparisonApps │
│ // { │
│ + allSimulations = { │
│ + type = "app"; │
│ + program = "${simulation.generateAllSimulationsScript pkgs}/bin/all-simu │
│ lations"; │
│ + }; │
│ getDB = { │
│ type = "app"; │
│ program = "${getDB}/bin/getDB"; │
└────────────────────────────────────────────────────────────────────────────────────┘ ┌─ nix/apps/default.nix ────────────── [ COPY ] ─┐
│ diff --git a/nix/apps/default.nix b/nix/apps │
│ /default.nix │
│ index a9c94d3..4d6703d 100644 │
│ --- a/nix/apps/default.nix │
│ +++ b/nix/apps/default.nix │
│ @@ -7,18 +7,45 @@ │
│ inputs, │
│ trinket, │
│ api, │
│ + simulation, │
│ ... │
│ }: { │
│ perSystem = {pkgs, ...}: let │
│ inherit (pkgs) writers python3Packages; │
│ - simulation = import ./simulation {inher │
│ it lib classes encounter buffs debuffs input │
│ s trinket pkgs;}; │
│ getDB = pkgs.callPackage ./getDB.nix {i │
│ nherit inputs;}; │
│ getCMLeaders = import ./challenge-mode- │
│ leaderboard.nix {inherit api writers python3 │
│ Packages;}; │
│ parseCMs = import ./challenge-mode-pars │
│ er.nix {inherit api writers python3Packages; │
│ }; │
│ + # Convert simulation data to apps │
│ + simulationApps = │
│ + lib.mapAttrs (name: sim: { │
│ + type = "app"; │
│ + program = "${sim.script}/bin/${sim. │
│ metadata.output}-aggregator"; │
│ + }) │
│ + (simulation.generateMassSimulations p │
│ kgs); │
│ + │
│ + raceComparisonApps = │
│ + lib.mapAttrs (name: raceComp: { │
│ + type = "app"; │
│ + program = "${raceComp.script}/bin/$ │
│ {raceComp.metadata.output}-aggregator"; │
│ + }) │
│ + (simulation.generateRaceComparisons p │
│ kgs); │
│ + │
│ + trinketComparisonApps = │
│ + lib.mapAttrs (name: trinketComp: { │
│ + type = "app"; │
│ + program = "${trinketComp.script}/bi │
│ n/${trinketComp.metadata.output}-aggregator" │
│ ; │
│ + }) │
│ + (simulation.generateTrinketComparison │
│ s pkgs); │
│ in { │
│ apps = │
│ - simulation │
│ + simulationApps │
│ + // raceComparisonApps │
│ + // trinketComparisonApps │
│ // { │
│ + allSimulations = { │
│ + type = "app"; │
│ + program = "${simulation.generateA │
│ llSimulationsScript pkgs}/bin/all-simulation │
│ s"; │
│ + }; │
│ getDB = { │
│ type = "app"; │
│ program = "${getDB}/bin/getDB"; │
└──────────────────────────────────────────────┘ ┌─ nix/apps/simulation/default.nix ───────────────────────────────────────── [ COPY ] ─┐
│ diff --git a/nix/apps/simulation/default.nix b/nix/apps/simulation/default.nix │
│ deleted file mode 100644 │
│ index 9eb7a34..0000000 │
│ --- a/nix/apps/simulation/default.nix │
│ +++ /dev/null │
│ @@ -1,160 +0,0 @@ │
│ -{ │
│ - lib, │
│ - pkgs, │
│ - classes, │
│ - encounter, │
│ - buffs, │
│ - debuffs, │
│ - inputs, │
│ - trinket, │
│ - ... │
│ -}: let │
│ - config = import ./config.nix {inherit encounter;}; │
│ - │
│ - massSimFunctions = import ./mkMassSim.nix {inherit lib pkgs classes encounter b │
│ uffs debuffs inputs;}; │
│ - inherit (massSimFunctions) mkMassSim mkRaceComparison; │
│ - │
│ - trinketComparison = import ./mkTrinketComparison.nix {inherit lib pkgs classes │
│ encounter buffs debuffs inputs trinket;}; │
│ - inherit (trinketComparison) mkTrinketComparison; │
│ - │
│ - generateScenarios = targetConfigs: durations: │
│ - lib.flatten (lib.mapAttrsToList ( │
│ - targetCount: targetConfig: │
│ - map (duration: { │
│ - inherit targetCount duration; │
│ - inherit (targetConfig) template; │
│ - encounter = targetConfig.encounters.${duration}; │
│ - }) │
│ - durations │
│ - ) │
│ - targetConfigs); │
│ - │
│ - scenarios = generateScenarios config.targetConfigs config.durations; │
│ - │
│ - makeMassSimName = phase: targetCount: duration: "dps-${phase}-raid-${targetCoun │
│ t}-${duration}"; │
│ - │
│ - massSimulations = lib.listToAttrs (lib.flatten (map ( │
│ - phase: │
│ - map (scenario: { │
│ - name = makeMassSimName phase scenario.targetCount scenario.duration; │
│ - value = mkMassSim { │
│ - inherit (config.common) iterations specs encounterType; │
│ - inherit (scenario) encounter targetCount duration template; │
│ - inherit phase; │
│ - }; │
│ - }) │
│ - scenarios │
│ - ) │
│ - config.phases)); │
│ - │
│ - # Generate race comparisons (specs ? scenarios) │
│ - raceComparisons = lib.listToAttrs (lib.flatten (map ( │
│ - specConfig: │
│ - map (scenario: { │
│ - name = "race-${specConfig.class}-${specConfig.spec}-p1-raid-${scenario. │
│ targetCount}-${scenario.duration}"; │
│ - value = mkRaceComparison { │
│ - inherit (specConfig) class spec; │
│ - inherit (scenario) encounter targetCount duration template; │
│ - inherit (config.common) encounterType iterations; │
│ - # only simulate race benchmarks for p1 │
│ - phase = "p1"; │
│ - }; │
│ - }) │
│ - scenarios │
│ - ) │
│ - config.raceComparisonSpecs)); │
│ - │
│ - # Generate trinket comparisons (specs ? scenarios) │
│ - trinketComparisons = lib.listToAttrs (lib.flatten (map ( │
│ - specConfig: │
│ - map (scenario: { │
│ - name = "trinket-${specConfig.class}-${specConfig.spec}-p1-raid-${scenar │
│ io.targetCount}-${scenario.duration}"; │
│ - value = mkTrinketComparison { │
│ - inherit (specConfig) class spec trinketCategory; │
│ - inherit (scenario) encounter duration template targetCount; │
│ - inherit (config.common) encounterType iterations; │
│ - phase = "p1"; │
│ - }; │
│ - }) │
│ - scenarios │
│ - ) │
│ - config.trinketComparisonSpecs)); │
│ - │
│ - # Script that runs all simulations │
│ - allSimulationsScript = pkgs.writeShellApplication { │
│ - name = "all-simulations"; │
│ - text = '' │
│ - echo "Running all WoW simulations..." │
│ - │
│ - echo "" │
│ - echo "=== DPS Rankings ===" │
│ - ${lib.concatMapStringsSep "\n" (name: '' │
│ - echo "" │
│ - echo "Running ${name}..." │
│ - ${massSimulations.${name}.script}/bin/${massSimulations.${name}.metadata. │
│ output}-aggregator │
│ - '') (lib.attrNames massSimulations)} │
│ - │
│ - echo "" │
│ - echo "=== Race Comparisons ===" │
│ - ${lib.concatMapStringsSep "\n" (name: '' │
│ - echo "" │
│ - echo "Running ${name}..." │
│ - ${raceComparisons.${name}.script}/bin/${raceComparisons.${name}.metadata. │
│ output}-aggregator │
│ - '') (lib.attrNames raceComparisons)} │
│ - │
│ - echo "" │
│ - echo "=== Trinket Comparisons ===" │
│ - ${lib.concatMapStringsSep "\n" (name: '' │
│ - echo "" │
│ - echo "Running ${name}..." │
│ - ${trinketComparisons.${name}.script}/bin/${trinketComparisons.${name}.met │
│ adata.output}-aggregator │
│ - '') (lib.attrNames trinketComparisons)} │
│ - │
│ - echo "" │
│ - echo "All simulations completed successfully!" │
│ - echo "" │
│ - echo "Generated DPS rankings:" │
│ - ls -la web/public/data/rankings/*.json 2>/dev/null || echo "No ranking file │
│ s found" │
│ - echo "" │
│ - echo "Generated race comparisons:" │
│ - find web/public/data/comparison/race -name "*.json" 2>/dev/null || echo "No │
│ race comparison files found" │
│ - echo "" │
│ - echo "Generated trinket comparisons:" │
│ - find web/public/data/comparison/trinkets -name "*.json" 2>/dev/null || echo │
│ "No trinket comparison files found" │
│ - ''; │
│ - runtimeInputs = [pkgs.coreutils pkgs.findutils]; │
│ - }; │
│ - │
│ - # Convert simulation outputs to nix apps │
│ - simulationApps = │
│ - lib.mapAttrs (name: massSim: { │
│ - type = "app"; │
│ - program = "${massSim.script}/bin/${massSim.metadata.output}-aggregator"; │
│ - }) │
│ - massSimulations; │
│ - │
│ - raceComparisonApps = │
│ - lib.mapAttrs (name: raceComp: { │
│ - type = "app"; │
│ - program = "${raceComp.script}/bin/${raceComp.metadata.output}-aggregator"; │
│ - }) │
│ - raceComparisons; │
│ - │
│ - trinketComparisonApps = │
│ - lib.mapAttrs (name: trinketComp: { │
│ - type = "app"; │
│ - program = "${trinketComp.script}/bin/${trinketComp.metadata.output}-aggrega │
│ tor"; │
│ - }) │
│ - trinketComparisons; │
│ -in │
│ - # Export all apps │
│ - simulationApps │
│ - // raceComparisonApps │
│ - // trinketComparisonApps │
│ - // { │
│ - allSimulations = { │
│ - type = "app"; │
│ - program = "${allSimulationsScript}/bin/all-simulations"; │
│ - }; │
│ - } │
│ - │
└────────────────────────────────────────────────────────────────────────────────────┘ ┌─ nix/apps/simulation/default.nix ─── [ COPY ] ─┐
│ diff --git a/nix/apps/simulation/default.nix │
│ b/nix/apps/simulation/default.nix │
│ deleted file mode 100644 │
│ index 9eb7a34..0000000 │
│ --- a/nix/apps/simulation/default.nix │
│ +++ /dev/null │
│ @@ -1,160 +0,0 @@ │
│ -{ │
│ - lib, │
│ - pkgs, │
│ - classes, │
│ - encounter, │
│ - buffs, │
│ - debuffs, │
│ - inputs, │
│ - trinket, │
│ - ... │
│ -}: let │
│ - config = import ./config.nix {inherit enc │
│ ounter;}; │
│ - │
│ - massSimFunctions = import ./mkMassSim.nix │
│ {inherit lib pkgs classes encounter buffs d │
│ ebuffs inputs;}; │
│ - inherit (massSimFunctions) mkMassSim mkRa │
│ ceComparison; │
│ - │
│ - trinketComparison = import ./mkTrinketCom │
│ parison.nix {inherit lib pkgs classes encoun │
│ ter buffs debuffs inputs trinket;}; │
│ - inherit (trinketComparison) mkTrinketComp │
│ arison; │
│ - │
│ - generateScenarios = targetConfigs: durati │
│ ons: │
│ - lib.flatten (lib.mapAttrsToList ( │
│ - targetCount: targetConfig: │
│ - map (duration: { │
│ - inherit targetCount duration; │
│ - inherit (targetConfig) template │
│ ; │
│ - encounter = targetConfig.encoun │
│ ters.${duration}; │
│ - }) │
│ - durations │
│ - ) │
│ - targetConfigs); │
│ - │
│ - scenarios = generateScenarios config.targ │
│ etConfigs config.durations; │
│ - │
│ - makeMassSimName = phase: targetCount: dur │
│ ation: "dps-${phase}-raid-${targetCount}-${d │
│ uration}"; │
│ - │
│ - massSimulations = lib.listToAttrs (lib.fl │
│ atten (map ( │
│ - phase: │
│ - map (scenario: { │
│ - name = makeMassSimName phase scen │
│ ario.targetCount scenario.duration; │
│ - value = mkMassSim { │
│ - inherit (config.common) iterati │
│ ons specs encounterType; │
│ - inherit (scenario) encounter ta │
│ rgetCount duration template; │
│ - inherit phase; │
│ - }; │
│ - }) │
│ - scenarios │
│ - ) │
│ - config.phases)); │
│ - │
│ - # Generate race comparisons (specs ? scen │
│ arios) │
│ - raceComparisons = lib.listToAttrs (lib.fl │
│ atten (map ( │
│ - specConfig: │
│ - map (scenario: { │
│ - name = "race-${specConfig.class}- │
│ ${specConfig.spec}-p1-raid-${scenario.target │
│ Count}-${scenario.duration}"; │
│ - value = mkRaceComparison { │
│ - inherit (specConfig) class spec │
│ ; │
│ - inherit (scenario) encounter ta │
│ rgetCount duration template; │
│ - inherit (config.common) encount │
│ erType iterations; │
│ - # only simulate race benchmarks │
│ for p1 │
│ - phase = "p1"; │
│ - }; │
│ - }) │
│ - scenarios │
│ - ) │
│ - config.raceComparisonSpecs)); │
│ - │
│ - # Generate trinket comparisons (specs ? s │
│ cenarios) │
│ - trinketComparisons = lib.listToAttrs (lib │
│ .flatten (map ( │
│ - specConfig: │
│ - map (scenario: { │
│ - name = "trinket-${specConfig.clas │
│ s}-${specConfig.spec}-p1-raid-${scenario.tar │
│ getCount}-${scenario.duration}"; │
│ - value = mkTrinketComparison { │
│ - inherit (specConfig) class spec │
│ trinketCategory; │
│ - inherit (scenario) encounter du │
│ ration template targetCount; │
│ - inherit (config.common) encount │
│ erType iterations; │
│ - phase = "p1"; │
│ - }; │
│ - }) │
│ - scenarios │
│ - ) │
│ - config.trinketComparisonSpecs)); │
│ - │
│ - # Script that runs all simulations │
│ - allSimulationsScript = pkgs.writeShellApp │
│ lication { │
│ - name = "all-simulations"; │
│ - text = '' │
│ - echo "Running all WoW simulations..." │
│ - │
│ - echo "" │
│ - echo "=== DPS Rankings ===" │
│ - ${lib.concatMapStringsSep "\n" (name: │
│ '' │
│ - echo "" │
│ - echo "Running ${name}..." │
│ - ${massSimulations.${name}.script}/b │
│ in/${massSimulations.${name}.metadata.output │
│ }-aggregator │
│ - '') (lib.attrNames massSimulations)} │
│ - │
│ - echo "" │
│ - echo "=== Race Comparisons ===" │
│ - ${lib.concatMapStringsSep "\n" (name: │
│ '' │
│ - echo "" │
│ - echo "Running ${name}..." │
│ - ${raceComparisons.${name}.script}/b │
│ in/${raceComparisons.${name}.metadata.output │
│ }-aggregator │
│ - '') (lib.attrNames raceComparisons)} │
│ - │
│ - echo "" │
│ - echo "=== Trinket Comparisons ===" │
│ - ${lib.concatMapStringsSep "\n" (name: │
│ '' │
│ - echo "" │
│ - echo "Running ${name}..." │
│ - ${trinketComparisons.${name}.script │
│ }/bin/${trinketComparisons.${name}.metadata. │
│ output}-aggregator │
│ - '') (lib.attrNames trinketComparisons │
│ )} │
│ - │
│ - echo "" │
│ - echo "All simulations completed succe │
│ ssfully!" │
│ - echo "" │
│ - echo "Generated DPS rankings:" │
│ - ls -la web/public/data/rankings/*.jso │
│ n 2>/dev/null || echo "No ranking files foun │
│ d" │
│ - echo "" │
│ - echo "Generated race comparisons:" │
│ - find web/public/data/comparison/race │
│ -name "*.json" 2>/dev/null || echo "No race │
│ comparison files found" │
│ - echo "" │
│ - echo "Generated trinket comparisons:" │
│ - find web/public/data/comparison/trink │
│ ets -name "*.json" 2>/dev/null || echo "No t │
│ rinket comparison files found" │
│ - ''; │
│ - runtimeInputs = [pkgs.coreutils pkgs.fi │
│ ndutils]; │
│ - }; │
│ - │
│ - # Convert simulation outputs to nix apps │
│ - simulationApps = │
│ - lib.mapAttrs (name: massSim: { │
│ - type = "app"; │
│ - program = "${massSim.script}/bin/${ma │
│ ssSim.metadata.output}-aggregator"; │
│ - }) │
│ - massSimulations; │
│ - │
│ - raceComparisonApps = │
│ - lib.mapAttrs (name: raceComp: { │
│ - type = "app"; │
│ - program = "${raceComp.script}/bin/${r │
│ aceComp.metadata.output}-aggregator"; │
│ - }) │
│ - raceComparisons; │
│ - │
│ - trinketComparisonApps = │
│ - lib.mapAttrs (name: trinketComp: { │
│ - type = "app"; │
│ - program = "${trinketComp.script}/bin/ │
│ ${trinketComp.metadata.output}-aggregator"; │
│ - }) │
│ - trinketComparisons; │
│ -in │
│ - # Export all apps │
│ - simulationApps │
│ - // raceComparisonApps │
│ - // trinketComparisonApps │
│ - // { │
│ - allSimulations = { │
│ - type = "app"; │
│ - program = "${allSimulationsScript}/bi │
│ n/all-simulations"; │
│ - }; │
│ - } │
│ - │
└──────────────────────────────────────────────┘ ┌─ nix/default.nix ───────────────────────────────────────────────────────── [ COPY ] ─┐
│ diff --git a/nix/default.nix b/nix/default.nix │
│ index 4cbd88d..e1ebe7a 100644 │
│ --- a/nix/default.nix │
│ +++ b/nix/default.nix │
│ @@ -1,6 +1,7 @@ │
│ { │
│ imports = [ │
│ ./shell.nix │
│ + ./simulation │
│ ./apps │
│ #./checks.nix │
│ ./pkgs │
└────────────────────────────────────────────────────────────────────────────────────┘ ┌─ nix/default.nix ─────────────────── [ COPY ] ─┐
│ diff --git a/nix/default.nix b/nix/default.n │
│ ix │
│ index 4cbd88d..e1ebe7a 100644 │
│ --- a/nix/default.nix │
│ +++ b/nix/default.nix │
│ @@ -1,6 +1,7 @@ │
│ { │
│ imports = [ │
│ ./shell.nix │
│ + ./simulation │
│ ./apps │
│ #./checks.nix │
│ ./pkgs │
└──────────────────────────────────────────────┘ ┌─ nix/pkgs/default.nix ──────────────────────────────────────────────────── [ COPY ] ─┐
│ diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix │
│ index a706234..e15ec36 100644 │
│ --- a/nix/pkgs/default.nix │
│ +++ b/nix/pkgs/default.nix │
│ @@ -4,6 +4,7 @@ │
│ encounter, │
│ buffs, │
│ debuffs, │
│ + simulation, │
│ ... │
│ }: { │
│ perSystem = { │
│ @@ -13,11 +14,21 @@ │
│ }: let │
│ inherit (pkgs) callPackage; │
│ inherit (inputs'.wowsims.packages) wowsimcli; │
│ + │
│ + # Convert simulation data to packages │
│ + simulationPackages = lib.mapAttrs (name: sim: sim.script) (simulation.generat │
│ eMassSimulations pkgs); │
│ + racePackages = lib.mapAttrs (name: sim: sim.script) (simulation.generateRaceC │
│ omparisons pkgs); │
│ + trinketPackages = lib.mapAttrs (name: sim: sim.script) (simulation.generateTr │
│ inketComparisons pkgs); │
│ in { │
│ - packages = { │
│ - testRaid = callPackage ./testRaid.nix { │
│ - inherit lib classes encounter buffs debuffs wowsimcli; │
│ + packages = │
│ + simulationPackages │
│ + // racePackages │
│ + // trinketPackages │
│ + // { │
│ + allSimulations = simulation.generateAllSimulationsScript pkgs; │
│ + testRaid = callPackage ./testRaid.nix { │
│ + inherit lib classes encounter buffs debuffs wowsimcli; │
│ + }; │
│ }; │
│ - }; │
│ }; │
│ } │
└────────────────────────────────────────────────────────────────────────────────────┘ ┌─ nix/pkgs/default.nix ────────────── [ COPY ] ─┐
│ diff --git a/nix/pkgs/default.nix b/nix/pkgs │
│ /default.nix │
│ index a706234..e15ec36 100644 │
│ --- a/nix/pkgs/default.nix │
│ +++ b/nix/pkgs/default.nix │
│ @@ -4,6 +4,7 @@ │
│ encounter, │
│ buffs, │
│ debuffs, │
│ + simulation, │
│ ... │
│ }: { │
│ perSystem = { │
│ @@ -13,11 +14,21 @@ │
│ }: let │
│ inherit (pkgs) callPackage; │
│ inherit (inputs'.wowsims.packages) wows │
│ imcli; │
│ + │
│ + # Convert simulation data to packages │
│ + simulationPackages = lib.mapAttrs (name │
│ : sim: sim.script) (simulation.generateMassS │
│ imulations pkgs); │
│ + racePackages = lib.mapAttrs (name: sim: │
│ sim.script) (simulation.generateRaceCompari │
│ sons pkgs); │
│ + trinketPackages = lib.mapAttrs (name: s │
│ im: sim.script) (simulation.generateTrinketC │
│ omparisons pkgs); │
│ in { │
│ - packages = { │
│ - testRaid = callPackage ./testRaid.nix │
│ { │
│ - inherit lib classes encounter buffs │
│ debuffs wowsimcli; │
│ + packages = │
│ + simulationPackages │
│ + // racePackages │
│ + // trinketPackages │
│ + // { │
│ + allSimulations = simulation.generat │
│ eAllSimulationsScript pkgs; │
│ + testRaid = callPackage ./testRaid.n │
│ ix { │
│ + inherit lib classes encounter buf │
│ fs debuffs wowsimcli; │
│ + }; │
│ }; │
│ - }; │
│ }; │
│ } │
└──────────────────────────────────────────────┘ ┌─ nix/shell.nix ─────────────────────────────────────────────────────────── [ COPY ] ─┐
│ diff --git a/nix/shell.nix b/nix/shell.nix │
│ index ee74445..9f84d44 100644 │
│ --- a/nix/shell.nix │
│ +++ b/nix/shell.nix │
│ @@ -11,7 +11,7 @@ │
│ (inputs'.wowsims.packages) │
│ wowsimcli │
│ ; │
│ - inherit (pkgs) nodejs; │
│ + inherit (pkgs) nodejs just; │
│ }; │
│ }; │
│ }; │
└────────────────────────────────────────────────────────────────────────────────────┘ ┌─ nix/shell.nix ───────────────────── [ COPY ] ─┐
│ diff --git a/nix/shell.nix b/nix/shell.nix │
│ index ee74445..9f84d44 100644 │
│ --- a/nix/shell.nix │
│ +++ b/nix/shell.nix │
│ @@ -11,7 +11,7 @@ │
│ (inputs'.wowsims.packages) │
│ wowsimcli │
│ ; │
│ - inherit (pkgs) nodejs; │
│ + inherit (pkgs) nodejs just; │
│ }; │
│ }; │
│ }; │
└──────────────────────────────────────────────┘ ┌─ nix/simulation/config.nix ─────────────────────────────────────────────── [ COPY ] ─┐
│ diff --git a/nix/apps/simulation/config.nix b/nix/simulation/config.nix │
│ similarity index 100% │
│ rename from nix/apps/simulation/config.nix │
│ rename to nix/simulation/config.nix │
└────────────────────────────────────────────────────────────────────────────────────┘ ┌─ nix/simulation/config.nix ───────── [ COPY ] ─┐
│ diff --git a/nix/apps/simulation/config.nix │
│ b/nix/simulation/config.nix │
│ similarity index 100% │
│ rename from nix/apps/simulation/config.nix │
│ rename to nix/simulation/config.nix │
└──────────────────────────────────────────────┘ ┌─ nix/simulation/default.nix ────────────────────────────────────────────── [ COPY ] ─┐
│ diff --git a/nix/simulation/default.nix b/nix/simulation/default.nix │
│ new file mode 100644 │
│ index 0000000..dce2d4f │
│ --- /dev/null │
│ +++ b/nix/simulation/default.nix │
│ @@ -0,0 +1,152 @@ │
│ +{ │
│ + lib, │
│ + classes, │
│ + encounter, │
│ + buffs, │
│ + debuffs, │
│ + inputs, │
│ + trinket, │
│ + ... │
│ +}: let │
│ + config = import ./config.nix {inherit encounter;}; │
│ + │
│ + # Utility functions │
│ + generateScenarios = targetConfigs: durations: │
│ + lib.flatten (lib.mapAttrsToList ( │
│ + targetCount: targetConfig: │
│ + map (duration: { │
│ + inherit targetCount duration; │
│ + inherit (targetConfig) template; │
│ + encounter = targetConfig.encounters.${duration}; │
│ + }) │
│ + durations │
│ + ) │
│ + targetConfigs); │
│ + │
│ + scenarios = generateScenarios config.targetConfigs config.durations; │
│ + makeMassSimName = phase: targetCount: duration: "dps-${phase}-raid-${targetCoun │
│ t}-${duration}"; │
│ + │
│ + # Function to generate mass simulations with pkgs │
│ + generateMassSimulations = pkgs: let │
│ + massSimFunctions = import ./mkMassSim.nix {inherit lib pkgs classes encounter │
│ buffs debuffs inputs;}; │
│ + inherit (massSimFunctions) mkMassSim; │
│ + in │
│ + lib.listToAttrs (lib.flatten (map ( │
│ + phase: │
│ + map (scenario: { │
│ + name = makeMassSimName phase scenario.targetCount scenario.duration; │
│ + value = mkMassSim { │
│ + inherit (config.common) iterations specs encounterType; │
│ + inherit (scenario) encounter targetCount duration template; │
│ + inherit phase; │
│ + }; │
│ + }) │
│ + scenarios │
│ + ) │
│ + config.phases)); │
│ + │
│ + # Function to generate race comparisons with pkgs │
│ + generateRaceComparisons = pkgs: let │
│ + massSimFunctions = import ./mkMassSim.nix {inherit lib pkgs classes encounter │
│ buffs debuffs inputs;}; │
│ + inherit (massSimFunctions) mkRaceComparison; │
│ + in │
│ + lib.listToAttrs (lib.flatten (map ( │
│ + specConfig: │
│ + map (scenario: { │
│ + name = "race-${specConfig.class}-${specConfig.spec}-p1-raid-${scenari │
│ o.targetCount}-${scenario.duration}"; │
│ + value = mkRaceComparison { │
│ + inherit (specConfig) class spec; │
│ + inherit (scenario) encounter targetCount duration template; │
│ + inherit (config.common) encounterType iterations; │
│ + # only simulate race benchmarks for p1 │
│ + phase = "p1"; │
│ + }; │
│ + }) │
│ + scenarios │
│ + ) │
│ + config.raceComparisonSpecs)); │
│ + │
│ + # Function to generate trinket comparisons with pkgs │
│ + generateTrinketComparisons = pkgs: let │
│ + trinketComparison = import ./mkTrinketComparison.nix {inherit lib pkgs classe │
│ s encounter buffs debuffs inputs trinket;}; │
│ + inherit (trinketComparison) mkTrinketComparison; │
│ + in │
│ + lib.listToAttrs (lib.flatten (map ( │
│ + specConfig: │
│ + map (scenario: { │
│ + name = "trinket-${specConfig.class}-${specConfig.spec}-p1-raid-${scen │
│ ario.targetCount}-${scenario.duration}"; │
│ + value = mkTrinketComparison { │
│ + inherit (specConfig) class spec trinketCategory; │
│ + inherit (scenario) encounter duration template targetCount; │
│ + inherit (config.common) encounterType iterations; │
│ + phase = "p1"; │
│ + }; │
│ + }) │
│ + scenarios │
│ + ) │
│ + config.trinketComparisonSpecs)); │
│ + │
│ + # Function to generate all simulations script with pkgs │
│ + generateAllSimulationsScript = pkgs: let │
│ + massSimulations = generateMassSimulations pkgs; │
│ + raceComparisons = generateRaceComparisons pkgs; │
│ + trinketComparisons = generateTrinketComparisons pkgs; │
│ + in │
│ + pkgs.writeShellApplication { │
│ + name = "all-simulations"; │
│ + text = '' │
│ + echo "Running all WoW simulations..." │
│ + │
│ + echo "" │
│ + echo "=== DPS Rankings ===" │
│ + ${lib.concatMapStringsSep "\n" (name: '' │
│ + echo "" │
│ + echo "Running ${name}..." │
│ + ${massSimulations.${name}.script}/bin/${massSimulations.${name}.metadat │
│ a.output}-aggregator │
│ + '') (lib.attrNames massSimulations)} │
│ + │
│ + echo "" │
│ + echo "=== Race Comparisons ===" │
│ + ${lib.concatMapStringsSep "\n" (name: '' │
│ + echo "" │
│ + echo "Running ${name}..." │
│ + ${raceComparisons.${name}.script}/bin/${raceComparisons.${name}.metadat │
│ a.output}-aggregator │
│ + '') (lib.attrNames raceComparisons)} │
│ + │
│ + echo "" │
│ + echo "=== Trinket Comparisons ===" │
│ + ${lib.concatMapStringsSep "\n" (name: '' │
│ + echo "" │
│ + echo "Running ${name}..." │
│ + ${trinketComparisons.${name}.script}/bin/${trinketComparisons.${name}.m │
│ etadata.output}-aggregator │
│ + '') (lib.attrNames trinketComparisons)} │
│ + │
│ + echo "" │
│ + echo "All simulations completed successfully!" │
│ + echo "" │
│ + echo "Generated DPS rankings:" │
│ + ls -la web/public/data/rankings/*.json 2>/dev/null || echo "No ranking fi │
│ les found" │
│ + echo "" │
│ + echo "Generated race comparisons:" │
│ + find web/public/data/comparison/race -name "*.json" 2>/dev/null || echo " │
│ No race comparison files found" │
│ + echo "" │
│ + echo "Generated trinket comparisons:" │
│ + find web/public/data/comparison/trinkets -name "*.json" 2>/dev/null || ec │
│ ho "No trinket comparison files found" │
│ + ''; │
│ + runtimeInputs = [pkgs.coreutils pkgs.findutils]; │
│ + }; │
│ + │
│ + simulation = { │
│ + # Generation functions that take pkgs as parameter │
│ + inherit generateMassSimulations generateRaceComparisons generateTrinketCompar │
│ isons generateAllSimulationsScript; │
│ + │
│ + # Configuration and utilities │
│ + inherit config generateScenarios scenarios; │
│ + │
│ + # Helper functions │
│ + inherit makeMassSimName; │
│ + }; │
│ +in { │
│ + flake.simulation = simulation; │
│ + _module.args.simulation = simulation; │
│ +} │
└────────────────────────────────────────────────────────────────────────────────────┘ ┌─ nix/simulation/default.nix ──────── [ COPY ] ─┐
│ diff --git a/nix/simulation/default.nix b/ni │
│ x/simulation/default.nix │
│ new file mode 100644 │
│ index 0000000..dce2d4f │
│ --- /dev/null │
│ +++ b/nix/simulation/default.nix │
│ @@ -0,0 +1,152 @@ │
│ +{ │
│ + lib, │
│ + classes, │
│ + encounter, │
│ + buffs, │
│ + debuffs, │
│ + inputs, │
│ + trinket, │
│ + ... │
│ +}: let │
│ + config = import ./config.nix {inherit enc │
│ ounter;}; │
│ + │
│ + # Utility functions │
│ + generateScenarios = targetConfigs: durati │
│ ons: │
│ + lib.flatten (lib.mapAttrsToList ( │
│ + targetCount: targetConfig: │
│ + map (duration: { │
│ + inherit targetCount duration; │
│ + inherit (targetConfig) template │
│ ; │
│ + encounter = targetConfig.encoun │
│ ters.${duration}; │
│ + }) │
│ + durations │
│ + ) │
│ + targetConfigs); │
│ + │
│ + scenarios = generateScenarios config.targ │
│ etConfigs config.durations; │
│ + makeMassSimName = phase: targetCount: dur │
│ ation: "dps-${phase}-raid-${targetCount}-${d │
│ uration}"; │
│ + │
│ + # Function to generate mass simulations w │
│ ith pkgs │
│ + generateMassSimulations = pkgs: let │
│ + massSimFunctions = import ./mkMassSim.n │
│ ix {inherit lib pkgs classes encounter buffs │
│ debuffs inputs;}; │
│ + inherit (massSimFunctions) mkMassSim; │
│ + in │
│ + lib.listToAttrs (lib.flatten (map ( │
│ + phase: │
│ + map (scenario: { │
│ + name = makeMassSimName phase sc │
│ enario.targetCount scenario.duration; │
│ + value = mkMassSim { │
│ + inherit (config.common) itera │
│ tions specs encounterType; │
│ + inherit (scenario) encounter │
│ targetCount duration template; │
│ + inherit phase; │
│ + }; │
│ + }) │
│ + scenarios │
│ + ) │
│ + config.phases)); │
│ + │
│ + # Function to generate race comparisons w │
│ ith pkgs │
│ + generateRaceComparisons = pkgs: let │
│ + massSimFunctions = import ./mkMassSim.n │
│ ix {inherit lib pkgs classes encounter buffs │
│ debuffs inputs;}; │
│ + inherit (massSimFunctions) mkRaceCompar │
│ ison; │
│ + in │
│ + lib.listToAttrs (lib.flatten (map ( │
│ + specConfig: │
│ + map (scenario: { │
│ + name = "race-${specConfig.class │
│ }-${specConfig.spec}-p1-raid-${scenario.targ │
│ etCount}-${scenario.duration}"; │
│ + value = mkRaceComparison { │
│ + inherit (specConfig) class sp │
│ ec; │
│ + inherit (scenario) encounter │
│ targetCount duration template; │
│ + inherit (config.common) encou │
│ nterType iterations; │
│ + # only simulate race benchmar │
│ ks for p1 │
│ + phase = "p1"; │
│ + }; │
│ + }) │
│ + scenarios │
│ + ) │
│ + config.raceComparisonSpecs)); │
│ + │
│ + # Function to generate trinket comparison │
│ s with pkgs │
│ + generateTrinketComparisons = pkgs: let │
│ + trinketComparison = import ./mkTrinketC │
│ omparison.nix {inherit lib pkgs classes enco │
│ unter buffs debuffs inputs trinket;}; │
│ + inherit (trinketComparison) mkTrinketCo │
│ mparison; │
│ + in │
│ + lib.listToAttrs (lib.flatten (map ( │
│ + specConfig: │
│ + map (scenario: { │
│ + name = "trinket-${specConfig.cl │
│ ass}-${specConfig.spec}-p1-raid-${scenario.t │
│ argetCount}-${scenario.duration}"; │
│ + value = mkTrinketComparison { │
│ + inherit (specConfig) class sp │
│ ec trinketCategory; │
│ + inherit (scenario) encounter │
│ duration template targetCount; │
│ + inherit (config.common) encou │
│ nterType iterations; │
│ + phase = "p1"; │
│ + }; │
│ + }) │
│ + scenarios │
│ + ) │
│ + config.trinketComparisonSpecs)); │
│ + │
│ + # Function to generate all simulations sc │
│ ript with pkgs │
│ + generateAllSimulationsScript = pkgs: let │
│ + massSimulations = generateMassSimulatio │
│ ns pkgs; │
│ + raceComparisons = generateRaceCompariso │
│ ns pkgs; │
│ + trinketComparisons = generateTrinketCom │
│ parisons pkgs; │
│ + in │
│ + pkgs.writeShellApplication { │
│ + name = "all-simulations"; │
│ + text = '' │
│ + echo "Running all WoW simulations.. │
│ ." │
│ + │
│ + echo "" │
│ + echo "=== DPS Rankings ===" │
│ + ${lib.concatMapStringsSep "\n" (nam │
│ e: '' │
│ + echo "" │
│ + echo "Running ${name}..." │
│ + ${massSimulations.${name}.script} │
│ /bin/${massSimulations.${name}.metadata.outp │
│ ut}-aggregator │
│ + '') (lib.attrNames massSimulations) │
│ } │
│ + │
│ + echo "" │
│ + echo "=== Race Comparisons ===" │
│ + ${lib.concatMapStringsSep "\n" (nam │
│ e: '' │
│ + echo "" │
│ + echo "Running ${name}..." │
│ + ${raceComparisons.${name}.script} │
│ /bin/${raceComparisons.${name}.metadata.outp │
│ ut}-aggregator │
│ + '') (lib.attrNames raceComparisons) │
│ } │
│ + │
│ + echo "" │
│ + echo "=== Trinket Comparisons ===" │
│ + ${lib.concatMapStringsSep "\n" (nam │
│ e: '' │
│ + echo "" │
│ + echo "Running ${name}..." │
│ + ${trinketComparisons.${name}.scri │
│ pt}/bin/${trinketComparisons.${name}.metadat │
│ a.output}-aggregator │
│ + '') (lib.attrNames trinketCompariso │
│ ns)} │
│ + │
│ + echo "" │
│ + echo "All simulations completed suc │
│ cessfully!" │
│ + echo "" │
│ + echo "Generated DPS rankings:" │
│ + ls -la web/public/data/rankings/*.j │
│ son 2>/dev/null || echo "No ranking files fo │
│ und" │
│ + echo "" │
│ + echo "Generated race comparisons:" │
│ + find web/public/data/comparison/rac │
│ e -name "*.json" 2>/dev/null || echo "No rac │
│ e comparison files found" │
│ + echo "" │
│ + echo "Generated trinket comparisons │
│ :" │
│ + find web/public/data/comparison/tri │
│ nkets -name "*.json" 2>/dev/null || echo "No │
│ trinket comparison files found" │
│ + ''; │
│ + runtimeInputs = [pkgs.coreutils pkgs. │
│ findutils]; │
│ + }; │
│ + │
│ + simulation = { │
│ + # Generation functions that take pkgs a │
│ s parameter │
│ + inherit generateMassSimulations generat │
│ eRaceComparisons generateTrinketComparisons │
│ generateAllSimulationsScript; │
│ + │
│ + # Configuration and utilities │
│ + inherit config generateScenarios scenar │
│ ios; │
│ + │
│ + # Helper functions │
│ + inherit makeMassSimName; │
│ + }; │
│ +in { │
│ + flake.simulation = simulation; │
│ + _module.args.simulation = simulation; │
│ +} │
└──────────────────────────────────────────────┘ ┌─ nix/simulation/mkMassSim.nix ──────────────────────────────────────────── [ COPY ] ─┐
│ diff --git a/nix/apps/simulation/mkMassSim.nix b/nix/simulation/mkMassSim.nix │
│ similarity index 100% │
│ rename from nix/apps/simulation/mkMassSim.nix │
│ rename to nix/simulation/mkMassSim.nix │
└────────────────────────────────────────────────────────────────────────────────────┘ ┌─ nix/simulation/mkMassSim.nix ────── [ COPY ] ─┐
│ diff --git a/nix/apps/simulation/mkMassSim.n │
│ ix b/nix/simulation/mkMassSim.nix │
│ similarity index 100% │
│ rename from nix/apps/simulation/mkMassSim.ni │
│ x │
│ rename to nix/simulation/mkMassSim.nix │
└──────────────────────────────────────────────┘ ┌─ nix/simulation/mkTrinketComparison.nix ────────────────────────────────── [ COPY ] ─┐
│ diff --git a/nix/apps/simulation/mkTrinketComparison.nix b/nix/simulation/mkTrinke │
│ tComparison.nix │
│ similarity index 100% │
│ rename from nix/apps/simulation/mkTrinketComparison.nix │
│ rename to nix/simulation/mkTrinketComparison.nix │
└────────────────────────────────────────────────────────────────────────────────────┘ ┌─ ...ation/mkTrinketComparison.nix ── [ COPY ] ─┐
│ diff --git a/nix/apps/simulation/mkTrinketCo │
│ mparison.nix b/nix/simulation/mkTrinketCompa │
│ rison.nix │
│ similarity index 100% │
│ rename from nix/apps/simulation/mkTrinketCom │
│ parison.nix │
│ rename to nix/simulation/mkTrinketComparison │
│ .nix │
└──────────────────────────────────────────────┘ [ BACK TO LOG ] ──────────────────────────────────────────────────────────────────────────────────────
OOKNET ────────────────────────────────────────────────
OOKNET