Here are my solutions of advent-of-code. The creator asked not to make the puzzles or input public, and I respect that of course.
If you plan to use my code, I recommend recreating the following folder structure. In my case, I included a git submodule to a private repository with the puzzles.
.
├── Cargo.lock
├── Cargo.toml
├── flake.lock
├── flake.nix
├── inputs (not included in this Repository)
│ └── y25
│ ├── d01
│ │ ├── input.txt
│ │ └── README.md
│ ├── d02
│ │ ├── input.txt
│ │ └── README.md
├── src
│ ├── main.rs
│ └── y25
│ ├── d01
│ │ ├── mod.rs
│ │ ├── part1.rs
│ │ └── part2.rs
│ ├── d02
│ │ ├── mod.rs
│ │ ├── part1.rs
│ │ └── part2.rs
git clone git@codeberg.org:blckr/advent-of-code.git
cd advent-of-codeSince this repository does not include puzzle descriptions or personal input files, you need to set them up yourself:
-
Create the input directory structure:
mkdir -p inputs/y25/d01 mkdir -p inputs/y25/d02 mkdir -p inputs/y25/d03 mkdir -p inputs/y25/d04
-
Add your input files:
- Download your puzzle input from adventofcode.com
- Place
input.txtin each day's folder (e.g.,inputs/y25/d01/input.txt)
-
(Optional) Use a private submodule: If you want to version control your inputs in a private repository, you can use a git submodule. See the "Using a Private Submodule" section below.
Execute solutions using the following syntax: cargo run <Year>.<Day>.<Part>. The year uses only the last 2 digits.
cargo run 25.1.1 # Year 2025, Day 1, Part 1
cargo run 25.4.2 # Year 2025, Day 4, Part 2This project includes a flake.nix that defines all dependencies for a reproducible development environment. To use it:
direnv allow # Automatically load the environmentOr run it without direnv:
nix flake shellIf you're not using Nix, simply ignore flake.nix and flake.lock.
If you want to version control your puzzle inputs and descriptions, but keep them private, you can use a git submodule to reference a private repository.
-
Create a private repository for your inputs on your Git Provider.
-
Add the submodule to this repository:
With SSH config alias:
git submodule add git@codeberg-blckr:blckr/advent-of-code-riddles.git inputs
Or with direct SSH URL:
git submodule add ssh://git@codeberg.org/blckr/advent-of-code-riddles.git inputs
-
Commit the changes:
git add .gitmodules inputs git commit -m "Add private inputs submodule"
When cloning this repository with a configured submodule, use:
git clone --recurse-submodules git@codeberg.org:blckr/advent-of-code.gitIf you've already cloned without submodules, initialize them:
git submodule update --init --recursiveTo pull the latest changes from your private inputs repository:
git submodule update --remoteOr navigate into the inputs directory and pull manually:
cd inputs
git pull origin main
cd ..
git add inputs
git commit -m "Update inputs"The inputs/ directory is intentionally not included in this repository to respect the Advent of Code creator's request not to share puzzle descriptions and personal input files publicly.