aoc/2024/09/solution.nix
2024-12-11 23:08:31 +00:00

14 lines
423 B
Nix

pkgs: input: let
inherit (pkgs) lib;
nix-solution = import ./bad.solution.nix pkgs input;
input-file = pkgs.writeText "input.txt" input;
bun-run = js-file: pkgs.runCommand "2024day9" {} ''
${lib.getExe pkgs.bun} ${js-file} ${input-file} > $out
'' |> builtins.readFile |> lib.trim;
in nix-solution // {
javascript = {
part1result = bun-run ./solution.js;
part2result = bun-run ./solution2.js;
};
}