{"slug": "notes-on-using-codecrafters-on-nixos", "title": "Notes on using CodeCrafters on NixOS", "summary": "A developer using CodeCrafters on NixOS reported that the platform's CLI runs `git add` on all non-ignored files in a project folder, causing remote test builds to fail with a \"failed to calculate checksum\" error when the `.direnv` directory was included. The fix was adding `.direnv` to `.gitignore`; the developer also set up a Python devshell via the-nix-way template and installed `pkgs.codecrafters-cli`, `ruff`, `ty` and `uv` from nixpkgs rather than curling the vendor install script.", "body_md": "# Notes on using CodeCrafters on NixOS\n\nAs I mentioned in my post on [practicing Rust](https://blog.matthewbrunelle.com/finally-actually-hopefully-learning-rust/), I'm a big fan of Anders Ericsson's concept of deliberate practice:\n\n- Setting aside time to practice specific skills with focused attention.\n- Not so hard that you can't make progress.\n- Not so easy that you don't stretch and learn anything (mindless repetition).\n- Getting feedback as you go.\n\nI'm especially trying to do this now without any form of AI assistance.\n\nFor a couple of months now I've been trying out CodeCrafters, which provides programming-in-the-medium-scale style projects. I'll note this post is not a review. Rather, I've run into gotchas with running the projects on NixOS and wanted to share notes.\n\n## Setting up a Python devshell\n\nWait, Python. I thought I was learning Rust? If I do a project for the first time in Rust, I'm both figuring out how to solve the project and learning the idiomatic way to write the project in Rust.\n\nPython is what I work in day-to-day, so I've started doing projects first in Python. That way I'm only thinking about how to do the implementation. Then I go back and redo the project in Rust with a focus on learning the language. Otherwise, I find myself in that spin-the-wheels territory of difficulty. So Python it is.\n\nThere are several ways you could set up a devshell. I'm using [the-nix-way template](https://github.com/the-nix-way/dev-templates?ref=blog.matthewbrunelle.com) which is a little heavy handed, but for practice work I want to spend my focus on the problem, rather than tooling setup.\n\nTo generate the devshell you just need to call `flake init` with the repo and the `python` tag:\n\n`nix flake init --template \"https://flakehub.com/f/the-nix-way/dev-templates/*#python\"`\n\nThen run `direnv allow` to load the devshell automatically when you change directory. I also added these packages:\n\n- pkgs.codecrafters-cli\n- pkgs.ruff\n- pkgs.ty\n- pkgs.uv\n\nThe instructions on the CodeCrafters site have you curl a script to install the CLI. We've always known this was a bad practice and the eMudhra certificate compromise made fclear why. Thankfully the CLI is available in nixpkgs.\n\nI also added ruff, ty and uv, but feel free to pick your flavor of Python tooling.\n\n## Make sure to git ignore the .direnv directory\n\nEach project section requires passing a set of remote automated tests. When I went to run my first test, I hit this failure:\n\n```\n[build] Starting build...\n[build] If you don't see logs for 60s+, please contact us at hello@codecrafters.io\n[build] Step 1 complete.\n[build] Step 2 complete.\n[build] Step 3 complete.\n[build] Step 4 complete.\n[build] Step 5 complete.\n[build] Step 6 complete.\n[build] Step 7 complete.\n[build] > [auth] Started verifying token authority from the client for registry-1.docker.io\n[build] > [auth] Completed verifying token authority from the client for registry-1.docker.io after 0.029s\n[build] Step 8 complete.\n[build] Step 9 complete.\n[build] Step 10 complete.\n[build] Step 11 complete.\n[build] Step 12 complete.\n[build] Step 13 complete.\n[build] Error: failed to calculate checksum of ref kxhqe7styo2ze7w6t4x9x1r79::vnpdjkei85yyrpecgdo099uku: \"/nix/store/5h3znhm5wqj8qsf9bf1apfl82cyfadxp-source\": not found.\n[build] Build failed. Check the logs above for the reason.\n[build] If you think this is a CodeCrafters error, please contact us at hello@codecrafters.io.\n```\n\nTurns out CodeCrafters will `git add` all files in the project folder that are not explicitly git ignored. I am not particularly a fan of this, especially since you are not warned.\n\nRegardless, the CLI was adding my .direnv folder, which references the Nix store, so I had to add `.direnv` to the `.gitignore` file.\n\nThose are the main road bumps I've run into so far. I'll update this post with more as I find them.\n\nOn the whole, the practice projects they have seem pretty okay, though some are better than others. Also, language coverage is not consistent across projects. For example, many do not offer Crystal as an option and the one that does is out of date.\n\nAlso, CodeCrafters is *extremely expensive*. They almost [went under](https://codecrafters.io/blog/pausing-new-challenges?ref=blog.matthewbrunelle.com) back in May, until they got a new CEO in September. Weirdly, I can't find the CEO announcement online anywhere, but in an email they said:\n\nIn late May, Paul and I shared that we were pausing development of new challenges. Following the news, our inboxes were filled with an incredible amount of love from you, and also expressions of sadness - which made it really difficult to not try harder to keep the mission going.\n\nSo at least for now I can keep practicing until my subscription ends.\n\nNo spam, no sharing to third party. Only you and me.", "url": "https://wpnews.pro/news/notes-on-using-codecrafters-on-nixos", "canonical_source": "https://blog.matthewbrunelle.com/notes-on-using-codecrafters-on-nixos/", "published_at": "2026-11-19 17:06:08+00:00", "updated_at": "2026-11-19 17:13:36.390592+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["CodeCrafters", "NixOS", "nixpkgs", "the-nix-way", "Anders Ericsson", "Rust", "Python"], "also_reported_by": [], "takeaway": "Add `.direnv` to `.gitignore` before running CodeCrafters tests, because the CLI `git add`s every non-ignored file and the Nix store reference in `.direnv` breaks the remote build's checksum step.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/notes-on-using-codecrafters-on-nixos", "markdown": "https://wpnews.pro/news/notes-on-using-codecrafters-on-nixos.md", "text": "https://wpnews.pro/news/notes-on-using-codecrafters-on-nixos.txt", "jsonld": "https://wpnews.pro/news/notes-on-using-codecrafters-on-nixos.jsonld"}}