Last time I showed a serialized derivation was a few days ago, things evolved a bit from there.
The current state is more like:
derivation hello {
builder "/bin/sh" "-c" "--" #"""
mkdir -p bin
printf '#!/bin/sh\necho Hello world!\n' >bin/hello
chmod +x bin/hello
"""#
output out {
path "/sickos/<hash>-hello-0"
hash algo=blake3 "49dc870df1de7fd60794cebce449f5ccdae575affaa67a24b62acb03e039db92"
}
system arch=x86-64 os=linux
}
I realized there's not much point in having builders other than an external one, except maybe the identity builder, which I can encode by not specifying a builder.
Technically, I wouldn't need the derivation hello wrapping, because a .drv will only ever contain a single derivation, and the name is unnecessary there. But gut feeling is that this'll be more convenient in the long run. If not, it's trivial to remove.
I will be changing the "name" to a path, though.