NixOs and Nix skill for LLM's

Portable skills for AI coding agents, maintained from pinned upstream sources. Notice!! This has been create with help of Claude,Codex and Antigravity agents with full human review.

Skill Purpose Initial reference
nix-language Write, explain, debug, and review Nix expressions Nix 2.35.2
devenv-project Configure and troubleshoot devenv project environments devenv v2.3.1
nixpkgs-development Package software and use Nixpkgs helpers, overlays, and library APIs master snapshot; development series 26.11
nixos-wiki Find retained NixOS configuration and troubleshooting guidance 17 curated topics from the 2026-09-22 dump

Please review and give feedback if this is usable for the community: GitHub - olafkfreund/nix-skills: Reusable AI agent skills for the Nix language, grounded in the upstream Nix manual. · GitHub

4 Likes

Nix-language: needs more description of idioms and best practices.

Devenv-project: references upstream’s skill, looks reasonable.

Nixpkgs: Likely needs more pointers to the various CONTRIBUTING files and folders. Show it nixpkgs-update and nixpkgs-review

General usage; I’ve found several horrible things being done that AI clearly needs guidance on.

  • find /nix/store/*something-* -iname libsomething.so please never do this
  • not understanding devShells
  • teach it nix-index
  • when packaging or running into errors it is almost always helpful to search through expertise in the Nixpkgs repo issues/prs
  • (my pet peeve: using python when awk/jq would be just as fine)

Also note that the entrypoint into the ecosytem for different people tends to fall into a few categories. Their user experience tends to be different enough to have specialized skills for:

  • developers: using Nix itself, devShells are common
  • home-manger: customizing, adjusting, often on darwin
  • nixos: system admins, mostly use nixos-rebuild switch

There are many tools out there that help people, nh, nix-eval-jobs, nix-output-monitor, and so forth. There are flakes and flake alternatives and many flake frameworks. There are a multitude of lang2nix tools that are hard to keep up with. Nix configuration can be complex due to client/daemon/remote distinctions. The skills should help navigate this complex ecosystem.

There is also lots of prior art out there, eg: GitHub - numtide/llm-agents.nix: Nix packages for AI coding agents and development tools. Automatically updated daily. · GitHub

7 Likes

This is very helpful feedback. Perfect Thank you

In opencode, you can configure an lsp for nix!

          lsp = {
            nixd = {
              command = [ (lib.getExe pkgs.nixd) ];
              extensions = [ ".nix" ];
              initialization = {
                nixpkgs.expr = "import <nixpkgs> { }";
                formatting = {
                  command = [ (lib.getExe pkgs.nixfmt) ];
                };
              };
            };
          };
2 Likes

That’s one of the top 2 issues I have with Nix and LLMs, that and quoting dashed attrset keys when that’s not required.

4 Likes

I use Nix almost entirely through devenv, and that includes when Claude Code is doing the work. What I’ve noticed is that agents do much better when the Nix they touch is a devenv.nix, because it’s a much smaller surface. So the devenv-project skill is the one I’d expect to earn its keep. tomberek’s list of what agents get wrong, like searching /nix/store for a library or misunderstanding devShells, reads to me like a case for pointing agents at a wrapper first and raw Nix second.

1 Like