Are you tired of boring Nix derivations that “just work” every time?
Do you think reproducibility is for the birds?
Do you like horrible things?
If you answered “yes” to any of these questions, then mkAIDerivation
is for you.
Generate a Nix derivation on the fly using an LLM
mkAIDerivation
uses an LLM over the network to generate a derivation on the fly for the given prompt you’ve passed in:
mkAIDerivation ''
Generate a derivation for building `xterm`
''
See the README in the repo for more information on how to use this.
26 Likes
Here I was about to make a quip about IFD, when I scroll down and find this uses evil-nix too…
I motion that nixpkgs immediately allow AI-generated submissions, but ONLY if they use this project.
To be clear, this is a joke.
7 Likes
This is hilarious(ly awful). I <love/hate> it.
5 Likes
Does this need a RFC first or can it be directly added to nixpkgs?
8 Likes
max
June 27, 2025, 10:48am
6
Damn, you beat me to it! Good thing I have a patent, you will hear from my lawyer.
Really clever use of evil-nix. My original idea for mkAIDerivation was to run llama.cpp in CPU mode inside the build sandbox, with a model downloaded by Nix. Since both of these approaches are terribly slow and inefficient, I wonder which one is faster.
3 Likes
max:
My original idea for mkAIDerivation was to run llama.cpp in CPU mode inside the build sandbox, with a model downloaded by Nix. Since both of these approaches are terribly slow and inefficient, I wonder which one is faster.
I didn’t really think of this when I was throwing together mkAIDerivation
!
It’d be fun to see an approach just using llama.cpp
and not having to go out to the network.
Salsa9
June 27, 2025, 9:17pm
8
I just ask AI in the chat to make it for me and then tweak details.
How well does it work with composition?
let
z3 = mkAIDerivation ''
Derivation for building the Z3 SMT solver, make it totally correct, without any issues
'';
in
prusa-slicer = mkAIDerivation ''
I'd like one (1) prusa-slicer please, btw this may be useful: ${z3}
''
3 Likes
I was falling asleep, but then I had to get out of bed and dig out the trash code I made at NixCon 2024 to do just this
like Nix's writeText but it uses an LLM to make nonsense
4 Likes
Already using Claude to create derivations for me but this make it one step further.
I wish AI could help me to solve the unfree predicate thing though…
That’s a bit offtopic, but you can make a new post topic to ask about this.