mkAIDerivation: generate a derivation on the fly from a prompt using an LLM

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.

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? :troll:

8 Likes

8 Likes

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

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.

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

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.