aoc/2024/default.nix

19 lines
479 B
Nix
Raw Normal View History

2024-12-11 23:08:31 +00:00
{pkgs ? import <nixpkgs> {}, aoc-inputs ? "/tmp/aoc-inputs"}:
let
inherit (pkgs) lib;
in
(lib.range 1 11
|> map (i: let id = lib.fixedWidthNumber 2 i; in {
name = "day-${id}";
value = let
solution = import ./${id}/solution.nix pkgs;
example = (pkgs.lib.readFile ./${id}/example.txt);
input = (pkgs.lib.readFile "${aoc-inputs}/${id}");
in {
example = solution example;
real = solution input;
};
})
|> builtins.listToAttrs
)