(ノ ◕ ヮ ◕)ノ*:・゚ ✧ Advent of Code 2023 (◕‿◕✿)
We'll need 2 env vars:
AOC_SESSION
will hold your personal AoC session cookieAOC_INPUT_PATH
is the path to theinput
dir within this repo, eg.~/code/aoc2023/input
echo 'export AOC_SESSION=<my-aoc-session>' >> .envrc.private
echo 'export AOC_INPUT_PATH=<my-aoc-input-path>' >> .envrc.private
direnv allow .
The project is using Nixkell
Use mkday.sh
to fetch the input file and generate a template module and spec for it.
scripts/mkday.sh # current date
scripts/mkday.sh 01 # current year, specific day
scripts/mkday.sh 2023 01 # specific date
scripts/comp.sh
scripts/solve.sh # current date
scripts/solve.sh 01 # specific day
scripts/solve.sh 2023 01 # specific date
Notes:
optimization
incabal.project
is set to0
for fast dev UX. Setting it to2
can significantly speed up solvers- For profiling flip the relevant flags in
nixkell.toml
(for GHC profiling overrides) and incabal.project
(for profiling builds)
scripts/test.sh
treefmt
hlint .
scripts/shellcheck.sh
build
aoc fetch --year 2023 --day 01
aoc solve --year 2023 --day 01
hyperfine --warmup 3 -- 'scripts/solve.sh 2023 01'
hyperfine --warmup 3 -- 'aoc solve -y 2023 -d 01'
Configure CACHIX_SIGNING_KEY
as a repository secret (see: https://nix.dev/tutorials/continuous-integration-github-actions)