Skip to content
vic

vic/aoc-devenv-template

Template for starting Advent Of Code using Nix devenv.

vic/aoc-devenv-template.json
{
"defaultBranch": "main",
"description": "Template for starting Advent Of Code using Nix devenv.",
"fullName": "vic/aoc-devenv-template",
"homepage": "",
"language": "Nix",
"name": "aoc-devenv-template",
"pushedAt": "2023-12-01T18:12:15Z",
"stargazersCount": 2,
"updatedAt": "2023-12-03T05:27:11Z",
"url": "https://github.com/vic/aoc-devenv-template"
}

Template for starting Advent Of Code using Nix devenv.

Section titled “Template for starting Advent Of Code using Nix devenv.”

  • Install Nix

  • Enable the Languages you are using by editing flakeModules/default.nix.

    You can also add unlisted languages if they package is available at nixpkgs. There’s also an example of a custom language derivation (see flakeModules/flix).

  • Enter the environment.

    If you have direnv already installed, this repo includes an .envrc file to load the default devenv. Otherwise you might want to run: nix develop --impure.

  • Use the aoc-cli to retrieve and submit your puzzles.

    Login at adventofcode.com and download the value of your session cookie to ~/.adventofcode.session.

    Use aoc calendar to confirm you can use the API.

  • Start coding a puzzle.

    Use just init <lang> <day> to create language project for that day puzzle. e.g. just init rust 1 will create a rust project under day1/rust and provide the puzzle input.

  • Get fun.

    Use just watch <lang> <day> to run your project on changes.

  • Submit your answer.

    Use aoc submit --day <DAY> <PART> <ANSWER>