Hello!
Thanks for the CC, Josselin!
I like Maxim's idea of providing all kinds of arguments through a separate file or stdin.
Here's a tiny proof-of-concept script implementing that:
-----guix-shell-with-args.sh----
#!/usr/bin/env bash
argstr=""
while read line
do
argstr="$argstr $line"
done < "${1:-/dev/stdin}"
guix shell $argstr
----------------------------------------
This takes arguments from either a file or stdin.
It is also possible to provide an arg file and supply additional arguments from stdin (i.e. echo "arguments" | ./guix-shell-with-args.sh /some/file-containing-args will take arguments from both)
This functionality could be baked into guix shell itself, wherein if you pass an argument (say "-a") it will read arguments from either a supplied file or stdin.
(of course, some error handling needs to be added)
I would like to have a more lisp-y way of doing this, however, if I'm being honest.
Perhaps we could add some code that goes over a list from stdin/files?
Input could potentially look like this:
'(C N (with-source pkgname src) (with-input a b))
which would give
guix shell -C -N --with-source=pkgname=src --with-input=a=b
Wdyt?
---
Happy hacking!
Sarthak