Remix.run Logo
jquaint 3 days ago

AI + Nix is indeed amazing!

https://github.com/utensils/mcp-nixos

Highly recommend this + nix flake check for best results.

pxc 3 days ago | parent [-]

IME LLMs are only useful for very basic completion, answering careful questions about Nixpkgs idioms, and some basic packaging stuff (but it's easier to just read the manual for that), when it comes to Nix. They generate needlessly overcomplicated code, and they are worse than useless when it comes to the module system (always falling into infinite recursion problems and giving you nonsense solutions to it).

What have your successes in using LLMs to write Nix code looked like?

jquaint 3 days ago | parent [-]

For me, the success is having a simple way to prompt an Agent AI to modify my NixOS desktop and get live feedback.

It can use the above MCP to search NixOS options and packages for me and make recommendations and edit the actual files, rebuild, etc.

It can then use nix flake check and other commands to verify the work it does actually did what was expected.

Even if there is still a bad result from time to time, I find this pretty valuable!